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
len bytes into the specified byte[] , starting from
the specified offset. | |||||||||||
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
|
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 len
bytes into the specified byte[]
, starting from
the specified offset. Updates the digest if this function is
on(boolean)
.
This operation is blocking.
b | the byte array in which to store the bytes |
---|---|
off | the initial position in b to store the bytes read from
this stream |
len | the maximum number of bytes to store in b |
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
.