Code example for DigestOutputStream

Methods: getMessageDigest, setMessageDigest

0
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "getMessageDigest", 
        args = {} 
    ) 
    public void test_getMessageDigest() { 
 
        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());
    } 
 
    /**