Code example for DigestInputStream

Methods: onread

        // changed 
        assertTrue("MessageDigest changed even though processing was off",
                MessageDigest.isEqual(noChangeDigest.digest(), originalDigest
        MessageDigest changeDigest = (MessageDigest) (digest.clone());
        dis = new DigestInputStream(inStream, digest);
        // turn on processing 
        c =;
        assertEquals('h', c);
        // make sure the digest has changed 
        assertTrue("MessageDigest did not change with processing on",
                !MessageDigest.isEqual(digest.digest(), changeDigest.digest()));
	 * @tests 
Contextual code suggestions in your IDE  Get Codota for Java