Bug in DataInputStream (readInt)
Per Bothner
per@bothner.com
Tue Sep 25 09:11:00 GMT 2001
Martin Kahlert wrote:
>So why has this been changed? Is there some deep rewrite of the IO classes
>happening?
>I don't know if using the helper buf is a good idea or not. My first
intuition is that
it is usually redundant (most of the type the underlying InputStream would
be buffered), and when it isn't, it's probably a tossup whether it makes any
difference.
> I ask, because i want to know if BufferedInputStream::read should
>try harder to obtain all wanted bytes,
>No.
>Or if DataInputStream should re-call
>BufferedInputStream::read again until it has all the bytes it wants to have.
>Yes. If it is going to use a buf, it is going to have to do something like
in.readFully(buf, 0, 4) (except of course InputStream doesn't have
readFully).
More information about the Java
mailing list