harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hindess <mark.hind...@googlemail.com>
Subject Re: [classlib] BufferedReader and FileInputStream.available()
Date Thu, 12 Nov 2009 23:02:33 GMT

In message <4AF8EDA6.9080703@gmail.com>, Regis writes:
> I just found a way can remove the in.available() check here. Instead
> of checking in.available, I check whether the last char read from
> stream is '\n'.

This seems to assume that the last character read from a tty is always a
'\n' but that is only true for default terminal settings.  For example,
after "stty -icanon" characters are available to be read immediately so the
buffer will not always end in a newline.


View raw message