Code example for DigestOutputStream

Methods: write

0
     * Test #4 for <code>write(byte[],int,int)</code> method<br> 
     *  
     * Assertion: put bytes into output stream<br> 
     *  
     * Assertion: does not update associated digest if digest 
     * functionality is off<br> 
     */ 
    @TestTargetNew( 
        level = TestLevel.PARTIAL_COMPLETE, 
        method = "write", 
        args = {byte[].class, int.class, int.class} 
    ) 
    public final void test_write$BII_4() 
        throws NoSuchAlgorithmException, 
               IOException { 
        // check precondition 
        assertEquals(0, MY_MESSAGE_LEN % CHUNK_SIZE);
 
        for (int k=0; k<algorithmName.length; k++) {
            try { 
                ByteArrayOutputStream bos = new ByteArrayOutputStream(MY_MESSAGE_LEN);