Code example for DigestOutputStream

Methods: getMessageDigest

0
 
        MessageDigest digest = new MyMessageDigest1();
        OutputStream out = new MyOutputStream();
 
        // non-null parameter 
        DigestOutputStream dos = new DigestOutputStream(out, digest);
        assertSame(digest, dos.getMessageDigest());
 
        // null parameter 
        dos = new DigestOutputStream(out, null);
        assertNull("getMessageDigest should have returned null", dos.getMessageDigest());
    } 
 
    /** 
     * java.security.DigestOutputStream#setMessageDigest(MessageDigest) 
     */ 
    public void test_setMessageDigestLjava_security_MessageDigest() { 
 
        MessageDigest digest = new MyMessageDigest1();
        OutputStream out = new MyOutputStream();