@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(expected = IllegalArgumentException.class)
    public void testCheckAvailable_negativePos() throws Exception {
        out.writeInt(-1, 1);

    }