InputStream that maintains a hash of the data read from it.
| Modifier and Type | Field and Description |
|---|---|
| private final Hasher |
| Access | Constructor and Description |
|---|---|
| public | HashingInputStream(HashFunction hashFunction, InputStream in)
Creates an input stream that hashes using the given |
| Modifier and Type | Method and Description |
|---|---|
| public HashCode | |
| public void | mark(int
the maximum limit of bytes that can be read before
the mark position becomes invalid. readlimit)Overrides java. |
| public boolean | Returns: false alwaysOverrides java. |
| public int | read()
Overrides java. |
| public int | read(byte[]
the buffer into which the data is read. bytes, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. |
| public void |
| hasher | back to summary |
|---|---|
| private final Hasher hasher | |
| HashingInputStream | back to summary |
|---|---|
| public HashingInputStream(HashFunction hashFunction, InputStream in) Creates an input stream that hashes using the given The | |
| hash | back to summary |
|---|---|
| public HashCode hash() Returns the | |
| mark | back to summary |
|---|---|
| public void mark(int readlimit) Overrides java. mark() is not supported for HashingInputStream
| |
| markSupported | back to summary |
|---|---|
| public boolean markSupported() Overrides java. mark() is not supported for HashingInputStream
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Reads the next byte of data from the underlying input stream and updates the hasher with the byte read.
| |
| read | back to summary |
|---|---|
| public int read(byte[] bytes, int off, int len) throws IOException Overrides java. Reads the specified bytes of data from the underlying input stream and updates the hasher with the bytes read.
| |
| reset | back to summary |
|---|---|
| public void reset() throws IOException Overrides java. reset() is not supported for HashingInputStream.
| |