Patch: fixlet for InputStreamReader

Jeff Sturm jsturm@one-point.com
Mon Aug 6 17:02:00 GMT 2001


On 6 Aug 2001, Tom Tromey wrote:
> I'm checking this in on the trunk.  This fixes a bug I found in
> InputStreamReader.  In some situations it would erroneously decide it
> hit EOF.  This happened because it was calling `in.refill ()' in the
> wrong situation.

I was just looking at this problem.  Thanks!

I have a nit... the size of "work" buffer is hardcoded to 100.  That's the
upper bound on how many characters can be read into an array.  Given that
the underlying BufferInputStream buffers 2048 bytes, that hardly seems
optimal.

Ideally the converter would write directly to the user-supplied buffer and
save an array copy.

Jeff



More information about the Java-patches mailing list