Bug in DataInputStream (readInt)
Tom Tromey
tromey@redhat.com
Wed Sep 26 15:16:00 GMT 2001
>>>>> "Per" == Per Bothner <per@bothner.com> writes:
>> So why has this been changed? Is there some deep rewrite of the IO
>> classes happening?
Per> I don't know if using the helper buf is a good idea or not. My
Per> first intuition is that it is usually redundant (most of the type
Per> the underlying InputStream would be buffered), and when it isn't,
Per> it's probably a tossup whether it makes any difference.
This got pulled in via Classpath.
I agree it seems dubious. I haven't changed it though.
Per> Yes. If it is going to use a buf, it is going to have to do
Per> something like in.readFully(buf, 0, 4) (except of course
Per> InputStream doesn't have readFully).
I changed calls to `in.read' to `readFully'.
This seemed reasonable to me.
I'm building it now; I'll check it in a bit later.
Tom
More information about the Java
mailing list