@Override
    public void writeShort(final int v) throws IOException {
        ensureAvailable(SHORT_SIZE_IN_BYTES);
        MEM.putShort(buffer, ARRAY_BYTE_BASE_OFFSET + pos, (short) v);
        pos += SHORT_SIZE_IN_BYTES;
    }
@Test
    public void testWriteShortForPositionVByteOrder() throws Exception {
        short expected = 100;
        out.writeShort(1, expected, ByteOrder.LITTLE_ENDIAN);
        out.writeShort(3, expected, ByteOrder.BIG_ENDIAN);
        short actual1 = Bits.readShort(out.buffer, 1, false);
        short actual2 = Bits.readShort(out.buffer, 3, true);

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