public final class HashingOutputStream extends FilterOutputStream
OutputStream that maintains a hash of the data written to it.out| 构造器和说明 |
|---|
HashingOutputStream(StreamingHasher hasher,
Integer seed,
OutputStream out) |
HashingOutputStream(StreamingHasher hasher,
OutputStream out)
Creates an output stream that hashes using the given
StreamingHasher, and forwards all
data written to it to the underlying OutputStream. |
public HashingOutputStream(StreamingHasher hasher, OutputStream out)
StreamingHasher, and forwards all
data written to it to the underlying OutputStream.
The OutputStream should not be written to before or after the hand-off.
public HashingOutputStream(StreamingHasher hasher, Integer seed, OutputStream out)
public void write(int b)
throws IOException
write 在类中 FilterOutputStreamIOExceptionpublic void write(byte[] bytes,
int off,
int len)
throws IOException
write 在类中 FilterOutputStreamIOExceptionpublic long getHash()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 FilterOutputStreamIOExceptionCopyright © 2022. All rights reserved.