/* * Unsigned Medium Int tests */ @Test public void testGetAndSetMediumInt() throws Exception { DynamicByteBuffer buf = new DynamicByteBuffer(); buf.putUnsigned(0x12); buf.putUnsigned(0x34); buf.putUnsigned(0x56); buf.flip(); assertEquals(0x123456, buf.getUnsignedMediumInt()); }
@SuppressWarnings("deprecation") @Test public void testGetAndSetMediumInt2() throws Exception { DynamicByteBuffer buf = new DynamicByteBuffer(); buf.order(java.nio.ByteOrder.LITTLE_ENDIAN); buf.putUnsigned(0x12); buf.putUnsigned(0x34); buf.putUnsigned(0x56); buf.flip(); assertEquals(0x563412, buf.getUnsignedMediumInt()); }
@Test(expected = BufferUnderflowException.class) public void testGetAndSetGetMediumIntException3() { DynamicByteBuffer buf = DynamicByteBuffer.allocate(0); buf.getUnsignedMediumInt(); }