@Override
    public void write(int b) {
        ensureAvailable(1);
        buffer[pos++] = (byte) (b);
    }
@Test
    public void testWriteForPositionB() {
        out.write(1, 5);
        assertEquals(5, out.buffer[1]);
    }