java.lang.Object | |||
↳ | java.io.InputStream | ||
↳ | java.io.FilterInputStream | ||
↳ | java.security.DigestInputStream |
DigestInputStream
is a FilterInputStream
which maintains an
associated message digest.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
digest | The message digest for this stream. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of this
DigestInputStream , using the
given stream and the digest .
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the message digest for this stream.
| |||||||||||
Enables or disables the digest function (default is on).
| |||||||||||
Reads the next byte and returns it as an
int .
| |||||||||||
Reads up to
byteCount bytes into buffer , starting at
byteOffset .
| |||||||||||
Sets the message digest which this stream will use.
| |||||||||||
Returns a string containing a concise, human-readable description of this
DigestInputStream including the digest.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs a new instance of this DigestInputStream
, using the
given stream
and the digest
.
Warning: passing a null source creates an invalid
DigestInputStream
. All operations on such a stream will fail.
Parameters | |
---|---|
stream |
InputStream :
the input stream. |
digest |
MessageDigest :
the message digest.
|
Returns the message digest for this stream.
Returns | |
---|---|
MessageDigest |
the message digest for this stream. |
Enables or disables the digest function (default is on).
Parameters | |
---|---|
on |
boolean :
true if the digest should be computed, false
otherwise. |
See also:
Reads the next byte and returns it as an int
. Updates the digest
for the byte if this function is on(boolean)
.
This operation is blocking.
Returns | |
---|---|
int |
the byte which was read or -1 at end of stream. |
Throws | |
---|---|
IOException |
if reading the source stream causes an IOException .
|
Reads up to byteCount
bytes into buffer
, starting at
byteOffset
. Updates the digest if this function is
on(boolean)
.
This operation is blocking.
Returns the number of bytes actually read or -1 if the end of the filtered stream has been reached while reading.
Parameters | |
---|---|
buffer |
byte
|
byteOffset |
int
|
byteCount |
int
|
Returns | |
---|---|
int |
Throws | |
---|---|
IOException |
if reading the source stream causes an IOException
|
Sets the message digest which this stream will use.
Parameters | |
---|---|
digest |
MessageDigest :
the message digest which this stream will use.
|
Returns a string containing a concise, human-readable description of this
DigestInputStream
including the digest.
Returns | |
---|---|
String |
a printable representation for this DigestInputStream .
|