Code example for DigestOutputStream

Methods: getMessageDigest, write

0
        try { 
            // Support_OutputStream throws an IOException if the internal 
            // buffer is full, which it should be now. 
            dos.write(myMessage, 0, MY_MESSAGE_LEN);
            fail("Test 1: IOException expected.");
        } catch (IOException e) {
            // Expected. 
        } 
    } 
 
    /** 
     * Test for <code>on()</code> method<br> 
     * Assertion: turns digest functionality on or off 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "on", 
        args = {boolean.class} 
    ) 
    public final void testOn() throws IOException {