@Test public void testPackUnpackLong() { long a = 0xdeadbeefdeadbeefL; long b = 0; byte[] c = new byte[Format.LONG_SIZE + 31]; Format.packLong(c, 10, a); b = Format.unpackLong(c, 10); assertEquals(a, b); }
@Test public void testPackUnpackInt() { int a = 0xdeadbeef; int b = 0; byte[] c = new byte[Format.INT_SIZE + 1]; Format.packInt(c, 1, a); b = Format.unpackInt(c, 1); log.debug("a = " + Integer.toHexString(a) + ", b = " + Integer.toHexString(b)); assertEquals(a, b); }