@Override
    public void write(int b) {
        ensureAvailable(1);
        buffer[pos++] = (byte) (b);
    }
@Test
    public void testWriteForBOffLen() {
        byte[] zeroBytes = new byte[20];
        out.write(zeroBytes, 0, 20);
        byte[] bytes = Arrays.copyOfRange(out.buffer, 0, 20);

        assertArrayEquals(zeroBytes, bytes);
        assertEquals(20, out.pos);
    }