@Test
public void testFloat() {
for (ByteOrder bo : new ByteOrder[] { ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN }) {
ByteBuffer bb = (ByteBuffer) ByteBuffer.allocate(5).order(bo).putFloat(-0.68f).rewind();
IoBuffer ioBuffer = IoBuffer.wrap(bb).order(bo);
assertEquals(5, ioBuffer.capacity());
ioBuffer.extend(3);
ioBuffer.position(4);
assertEquals(8, ioBuffer.capacity());
ioBuffer.putFloat(3.14f);
ioBuffer.rewind();
assertEquals(-0.68f, ioBuffer.getFloat(), 0.001f);
assertEquals(3.14f, ioBuffer.getFloat(), 0.001f);
ioBuffer.rewind();
ioBuffer.putFloat(2, -12.34f);
assertEquals(-12.34f, ioBuffer.getFloat(2), 0.001f);
}
}