This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: fixlet for InputStreamReader


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]