Code example for CRC32

Methods: getValue, reset, update

0
	 * @tests java.util.zip.CRC32#update(byte[]) 
	 */ 
	public void test_update$B() { 
		// test methods of java.util.zip.crc32.update(byte[]) 
		byte byteArray[] = { 1, 2 };
		CRC32 crc = new CRC32();
		crc.update(byteArray);
		// System.out.print("value of crc"+crc.getValue()); 
		// Ran JDK and discovered that the value of the CRC should be 
		// 3066839698 
		assertEquals("update(byte[]) failed to update the checksum to the correct value ",
				3066839698L, crc.getValue());
 
		crc.reset();
		byte byteEmpty[] = new byte[10000];
		crc.update(byteEmpty);
		// System.out.print("value of crc"+crc.getValue()); 
		// Ran JDK and discovered that the value of the CRC should be 
		// 1295764014 
		assertEquals("update(byte[]) failed to update the checksum to the correct value ",
				1295764014L, crc.getValue());
	} 
 
	/** 
	 * @tests java.util.zip.CRC32#update(byte[], int, int) 
	 */