Reads up to len bytes from the stream, and stores
them into b starting at index off.
The number of bytes read is returned. If no bytes can be read
because the end of the stream has been reached, -1
is returned.
The bit offset within the stream is reset to zero before the read occurs.
b | an array of bytes to be written to. | |
off | the starting position within b to write to. | |
len | the maximum number of bytes to read. |
-1
to indicate EOF.
NullPointerException | if b is
null. | |
IndexOutOfBoundsException | if off is
negative, len is negative, or off +
len is greater than b.length. | |
IOException | if an I/O error occurs. |
Diagram: stream