Code example for Cipher

Methods: update

0
	/* 
	 * Class under test for byte[] update(byte[]) 
	 */ 
	public void testUpdatebyteArray() throws Exception { 
		byte [] b = {1, 2, 3, 4, 5};
		byte [] r = c.update(b);
        assertEquals("different length", b.length, r.length);
        assertTrue("different content", Arrays.equals(b, r));
	} 
 
	/* 
	 * Class under test for byte[] update(byte[], int, int) 
	 */ 
	public void testUpdatebyteArrayintint() throws Exception { 
		byte [] b = {1, 2, 3, 4, 5};
		byte [] r = c.update(b, 0, 5);
        assertEquals("different length", b.length, r.length);
        assertTrue("different content", Arrays.equals(b, r));
		 
		r = c.update(b, 1, 3);
		assertEquals("different length", 3, r.length);