Class MessageDigestCalculatingInputStream

All Implemented Interfaces:
Closeable, AutoCloseable

This class is an example for using an ObservableInputStream. It creates its own ObservableInputStream.Observer, which calculates a checksum using a MessageDigest, for example, a SHA-512 sum.

To build an instance, use MessageDigestCalculatingInputStream.Builder.

See the MessageDigest section in the Java Cryptography Architecture Standard Algorithm Name Documentation for information about standard algorithm names.

Note: Neither ObservableInputStream, nor MessageDigest, are thread safe, so is MessageDigestCalculatingInputStream.

See Also: