[patch] "\r\n" handling in DataInputStream.readLine()

Tom Tromey tromey@cygnus.com
Tue May 25 10:16:00 GMT 1999

>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:

Bryce> I have added an additional workaround to the two already
Bryce> implemented in this method (but which don't work for a plain
Bryce> FileInputStream).

I haven't read the patch yet.

Bryce> The only case where this doesn't provide correct behaviour
Bryce> would be if the user calls another DataInputStream method like
Bryce> read() after calling readLine(), in which case they will still
Bryce> get an '\n' sitting at the start of the stream.

Couldn't you reset the flag in these methods?

Even better would be Mauve tests to test for all the corner cases.
Then we could be sure we were really doing the right thing.


More information about the Java mailing list