Code example for NullCipher

0
    /** 
     * javax.crypto.CipherInputStream#read(byte[] b, int off, int len) 
     */ 
    public void testReadBII() throws Exception { 
        // Regression for HARMONY-1080 
        CipherInputStream stream = new CipherInputStream(null, new NullCipher());
        try { 
            stream.read(new byte[1], 1, 0);
            fail("NullPointerException expected");
        } catch (NullPointerException e) {
            // expected 
        } 
    } 
 
    /** 
     * javax.crypto.CipherInputStream#close() 
     */ 
    public void testClose() throws Exception { 
        // Regression for HARMONY-1087 
        try { 
            new CipherInputStream(new ByteArrayInputStream(new byte[] { 1 }),