@Test public void testUpdate() { final byte[] bytes = "Any String you want".getBytes(); final int len = bytes.length; Checksum crc1 = Crc32C.create(); Checksum crc2 = Crc32C.create(); Checksum crc3 = Crc32C.create(); crc1.update(bytes, 0, len); for (int i = 0; i < len; i++) crc2.update(bytes[i]); crc3.update(bytes, 0, len / 2); crc3.update(bytes, len / 2, len - len / 2); assertEquals("Crc values should be the same", crc1.getValue(), crc2.getValue()); assertEquals("Crc values should be the same", crc1.getValue(), crc3.getValue()); }
public static Checksum create() { return CHECKSUM_FACTORY.create(); }
Crc32C { public static Checksum create() { return CHECKSUM_FACTORY.create(); } }
Crc32C { public static Checksum create() { return CHECKSUM_FACTORY.create(); }  }
Crc32C { public static Checksum create() { return CHECKSUM_FACTORY.create(); }  static long compute(byte[] bytes, int offset, int size); static long compute(ByteBuffer buffer, int offset, int size); static Checksum create(); }
Crc32C { public static Checksum create() { return CHECKSUM_FACTORY.create(); }  static long compute(byte[] bytes, int offset, int size); static long compute(ByteBuffer buffer, int offset, int size); static Checksum create();  }