DigestInputStream.read

DigestInputStream.read

Class Overview | Class Members | This Package | All Packages

Syntax 1
public int read() throws IOException
Returns
the byte read.
Description
Reads a byte, and updates the message digest (if the digest function is on). That is, this method reads a byte from the input stream, blocking until the byte is actually read. If the digest function is on (see on), this method will then call update on the message digest associated with this stream, passing it the byte read.

Exceptions
IOException if an I/O error occurs.
Overrides
read in class FilterInputStream
See Also
update



Syntax 2
public int read( byte b[], int off, int len ) throws IOException
Parameters
b
the array into which the data is read.
off
the starting offset into b of where the data should be placed.
len
the maximum number of bytes to be read from the input stream into b, starting at offset off.
Returns
the actual number of bytes read. This is less than len if the end of the stream is reached prior to reading len bytes. -1 is returned if no bytes were read because the end of the stream had already been reached when the call was made.
Description
Reads into a byte array, and updates the message digest (if the digest function is on). That is, this method reads up to len bytes from the input stream into the array b, starting at offset off. This method blocks until the data is actually read. If the digest function is on (see on), this method will then call update on the message digest associated with this stream, passing it the data.

Exceptions
IOException if an I/O error occurs.
Overrides
read in class FilterInputStream
See Also
update