@Test
public void testDouble() {
for (ByteOrder bo : new ByteOrder[] { ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN }) {
ByteBuffer bb = (ByteBuffer) ByteBuffer.allocate(9).order(bo).putDouble(Math.PI).rewind();
IoBuffer ioBuffer = IoBuffer.wrap(bb).order(bo);
assertEquals(9, ioBuffer.capacity());
ioBuffer.extend(7);
ioBuffer.position(8);
assertEquals(16, ioBuffer.capacity());
ioBuffer.putDouble(-Math.E);
ioBuffer.rewind();
assertEquals(Math.PI, ioBuffer.getDouble(), 1E-10);
assertEquals(-Math.E, ioBuffer.getDouble(), 1E-10);
ioBuffer.rewind();
ioBuffer.putDouble(4, 12.34);
assertEquals(12.34, ioBuffer.getDouble(4), 1E-10);
}
}