readFully
Reads as much from input as possible to fill the given array.
This method may invoke read repeatedly to fill the array and only read less bytes than the length of the array if the end of the stream has been reached.
Return
the number of bytes actually read
Parameters
stream to read from
buffer to fill
Throws
on error
Reads as much from input as possible to fill the given array with the given amount of bytes.
This method may invoke read repeatedly to read the bytes and only read less bytes than the requested length if the end of the stream has been reached.
Return
the number of bytes actually read
Parameters
stream to read from
buffer to fill
offset into the buffer to start filling at
of bytes to read
Throws
if an I/O error has occurred
Reads b.remaining() bytes from the given channel starting at the current channel's position.
This method reads repeatedly from the channel until the requested number of bytes are read. This method blocks until the requested number of bytes are read, the end of the channel is detected, or an exception is thrown.
Parameters
the channel to read from
the buffer into which the data is read.
Throws
- if an I/O error occurs.
- if the channel reaches the end before reading all the bytes.