@Override
    public void writeInt(final int v) throws IOException {
        ensureAvailable(INT_SIZE_IN_BYTES);
        MEM.putInt(buffer, ARRAY_BYTE_BASE_OFFSET + pos, v);
        pos += INT_SIZE_IN_BYTES;
    }
@Test
    public void testWriteIntForPositionVByteOrder() throws Exception {
        int expected = 100;
        out.writeInt(10, expected, LITTLE_ENDIAN);
        out.writeInt(14, expected, BIG_ENDIAN);
        int actual1 = Bits.readInt(out.buffer, 10, false);
        int actual2 = Bits.readInt(out.buffer, 14, true);

        assertEquals(expected, actual1);
        assertEquals(expected, actual2);
    }