Reads some bytes from an input
stream and stores them into the buffer
array b. The number of bytes
read is equal
to the length of b.
This method blocks until one of the following conditions occurs:
b.length
bytes of input data are available, in which
case a normal return is made.
EOFException
is thrown.
IOException other
than EOFException is thrown.
If b is null,
a NullPointerException is thrown.
If b.length is zero, then
no bytes are read. Otherwise, the first
byte read is stored into element b[0],
the next one into b[1], and
so on.
If an exception is thrown from
this method, then it may be that some but
not all bytes of b have been
updated with data from the input stream.
b | the buffer into which the data is read. |
NullPointerException | if b is null. | |
EOFException | if this stream reaches the end before reading all the bytes. | |
IOException | if an I/O error occurs. |
Diagram: InputStream