public class CountingDigestOutputStream extends DigestOutputStream
DigestOutputStream that also keeps track of the total number of bytes written.digestout| Constructor and Description |
|---|
CountingDigestOutputStream(OutputStream outputStream)
Wraps the
outputStream. |
| Modifier and Type | Method and Description |
|---|---|
BlobDescriptor |
computeDigest()
Computes the hash and returns it along with the size of the bytes written to compute the hash.
|
void |
write(byte[] data,
int offset,
int length) |
void |
write(int singleByte) |
getMessageDigest, on, setMessageDigest, toStringclose, flush, writepublic CountingDigestOutputStream(OutputStream outputStream)
outputStream.outputStream - the OutputStream to wrap.public BlobDescriptor computeDigest()
public void write(byte[] data,
int offset,
int length)
throws IOException
write in class DigestOutputStreamIOExceptionpublic void write(int singleByte)
throws IOException
write in class DigestOutputStreamIOExceptionCopyright © 2019. All rights reserved.