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.
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.
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
.
Throws:
-
IOException - if an I/O error occurs.
See Also:
MessageDigest.update(byte[], int, int)
,