Class AnvDigestInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.saidone.misc.AnvDigestInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class AnvDigestInputStream extends FilterInputStream
AnvDigestInputStream wraps another InputStream and computes a message digest while the data is read.

The digest algorithm is provided at construction time and each read operation updates the underlying MessageDigest. When the stream has been consumed the final hash value can be obtained via getHash(). This utility is typically used when a checksum or fingerprint of the streamed content is required without buffering the entire input in memory.