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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.FilterInputStream
|
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.FilterInputStream
| |||||||||||
From class
java.io.InputStream
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.lang.AutoCloseable
|
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.
stream | the input stream. |
---|---|
digest | the message digest. |
Returns the message digest for this stream.
Enables or disables the digest function (default is on).
on | true if the digest should be computed, false
otherwise. |
---|
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.
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.
IOException | if reading the source stream causes an IOException
|
---|
Sets the message digest which this stream will use.
digest | the message digest which this stream will use. |
---|
Returns a string containing a concise, human-readable description of this
DigestInputStream
including the digest.
DigestInputStream
.