815816817818819820821822823824825
buf.put((byte) 0xCD); buf.flip(); buf.order(ByteOrder.LITTLE_ENDIAN); buf.mark(); assertEquals(0xA4, buf.getUnsigned()); buf.reset(); assertEquals(0xD0A4, buf.getUnsignedShort()); buf.reset(); assertEquals(0xCDB3D0A4L, buf.getUnsignedInt());
138139140141142143144145146147148
buf.put((byte) 0); buf.put((byte) 0); buf.put((byte) 0); // Position should be 3 when we reset this buffer. buf.mark(); // Overflow it buf.put((byte) 0); buf.put((byte) 0);