Class Sha256InputStreamDecorator

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class Sha256InputStreamDecorator
    extends InputStream
    Decorates an InputStream with the ability to compute a SHA-256 hash of the bytes read from the stream. Assumes that the entire stream is read. If buffering is done further up-stream, then obviously the digest may not represent what was actually read by the consumer, because the buffer may read bytes from this stream than were actually consumed. Caveat emptor.