public class CountingDigestOutputStream
extends java.security.DigestOutputStream
DigestOutputStream
that also keeps track of the total number of bytes written.Constructor and Description |
---|
CountingDigestOutputStream(java.io.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) |
public CountingDigestOutputStream(java.io.OutputStream outputStream)
outputStream
.outputStream
- the OutputStream
to wrap.public BlobDescriptor computeDigest()
public void write(byte[] data, int offset, int length) throws java.io.IOException
write
in class java.security.DigestOutputStream
java.io.IOException
public void write(int singleByte) throws java.io.IOException
write
in class java.security.DigestOutputStream
java.io.IOException