public static HashingInputStream createHashingStream( Algorithm algorithm,
                                                          InputStream inputStream ) throws NoSuchAlgorithmException {
        return createHashingStream(algorithm.digestName(), inputStream);
    }
public static HashingInputStream createHashingStream ( Algorithm algorithm , InputStream inputStream ) throws NoSuchAlgorithmException { return createHashingStream ( algorithm . digestName ( ) , inputStream ) ; }
Create an InputStream instance that wraps another stream and that computes the secure hash (using the algorithm with the
supplied name) as the returned stream is used. This can be used to compute the hash of a stream while the stream is being
processed by another reader, and saves from having to process the same stream twice.

@param algorithm the hashing function algorithm that should be used
@param inputStream the stream containing the content that is to be hashed
@return the hash of the contents as a byte array
@throws NoSuchAlgorithmException