817818819820821822823824825826827
buf.order(ByteOrder.LITTLE_ENDIAN); buf.mark(); assertEquals(0xA4, buf.getUnsigned()); buf.reset(); assertEquals(0xD0A4, buf.getUnsignedShort()); buf.reset(); assertEquals(0xCDB3D0A4L, buf.getUnsignedInt()); }
819820821822823824825826827828829
buf.mark(); assertEquals(0xA4, buf.getUnsigned()); buf.reset(); assertEquals(0xD0A4, buf.getUnsignedShort()); buf.reset(); assertEquals(0xCDB3D0A4L, buf.getUnsignedInt()); } @Test
145146147148149150151152153154155
// Overflow it buf.put((byte) 0); buf.put((byte) 0); assertEquals(5, buf.position()); buf.reset(); assertEquals(3, buf.position()); } @Test