read
See the general contract of the read method of InputStream.
Return
the next byte of data, or -1 if the end of the stream is reached.
See also
in
Throws
if this input stream has been closed by invoking its .close method, or an I/O error occurs.
Reads bytes from this byte-input stream into the specified byte array, starting at the given offset.
This method implements the general contract of the corresponding read method of the InputStream class. As an additional convenience, it attempts to read as many bytes as possible by repeatedly invoking the read method of the underlying stream. This iterated read continues until one of the following conditions becomes true:
The specified number of bytes have been read,
The
readmethod of the underlying stream returns-1, indicating end-of-file, orThe
availablemethod of the underlying stream returns zero, indicating that further input requests would block.
If the first read on the underlying stream returns -1 to indicate end-of-file then this method returns -1. Otherwise, this method returns the number of bytes actually read.
Subclasses of this class are encouraged, but not required, to attempt to read as many bytes as possible in the same fashion.
Return
the number of bytes read, or -1 if the end of the stream has been reached.
Parameters
destination buffer.
offset at which to start storing bytes.
maximum number of bytes to read.
Throws
if this input stream has been closed by invoking its .close method, or an I/O error occurs.
{@inheritDoc}