Patch: fixlet for InputStreamReader

Tom Tromey tromey@redhat.com
Wed Aug 8 10:54:00 GMT 2001


>>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:

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

That makes sense.  Feel free to check in a better value.

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

I think that could be done with some changes to refill().
If you're interested, go for it.  Like I said earlier, this code could
stand some closer attention.  I think it is still possible for it to
fail (go into an infinite loop making no progress) if there is an
incomplete byte sequence at the end of the byte buffer.  Bleah.

Tom



More information about the Java-patches mailing list