This is the mail archive of the java@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: Bug in DataInputStream (readInt)


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).



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