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 |
|---|---|
long |
getTotalBytes() |
BlobDescriptor |
toBlobDescriptor()
Builds a
BlobDescriptor with the hash and size of the bytes written. |
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 toBlobDescriptor()
BlobDescriptor with the hash and size of the bytes written. The buffer resets
after this method is called, so this method should only be called once per BlobDescriptor.BlobDescriptor.public long getTotalBytes()
public void write(byte[] data,
int offset,
int length)
throws java.io.IOException
write in class java.security.DigestOutputStreamjava.io.IOExceptionpublic void write(int singleByte)
throws java.io.IOException
write in class java.security.DigestOutputStreamjava.io.IOException