public final class HashingInputStream extends FilterInputStream
in| 构造器和说明 |
|---|
HashingInputStream(StreamingHasher hasher,
InputStream in)
Creates an input stream that hashes using the given
StreamingHasher and delegates all data
read from it to the underlying InputStream. |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getHash()
Returns the hash code based on the data read from this stream.
|
void |
mark(int readlimit)
mark() is not supported for HashingInputStream
|
boolean |
markSupported()
mark() is not supported for HashingInputStream
|
int |
read()
Reads the next byte of data from the underlying input stream and updates the hasher with the
byte read.
|
int |
read(byte[] bytes,
int off,
int len)
Reads the specified bytes of data from the underlying input stream and updates the hasher with
the bytes read.
|
void |
reset()
reset() is not supported for HashingInputStream.
|
available, close, read, skippublic HashingInputStream(StreamingHasher hasher, InputStream in)
StreamingHasher and delegates all data
read from it to the underlying InputStream.
The InputStream should not be read from before or after the hand-off.
public int read()
throws IOException
read 在类中 FilterInputStreamIOExceptionpublic int read(byte[] bytes,
int off,
int len)
throws IOException
read 在类中 FilterInputStreamIOExceptionpublic boolean markSupported()
markSupported 在类中 FilterInputStreamfalse alwayspublic void mark(int readlimit)
mark 在类中 FilterInputStreampublic void reset()
throws IOException
reset 在类中 FilterInputStreamIOException - this operation is not supportedpublic long getHash()
Copyright © 2022. All rights reserved.