@Override
    public void write(int b) {
        int newCount = mCount + 1;
        if (newCount > mBuffer.length) {
            mBuffer = Bytes.copyOf(mBuffer, Math.max(mBuffer.length << 1, newCount));
        }
        mBuffer[mCount] = (byte) b;
        mCount = newCount;
    }
@Test
    void testWrite() {
        UnsafeByteArrayOutputStream outputStream = new UnsafeByteArrayOutputStream(1);
        outputStream.write((int) 'a');
        outputStream.write("bc".getBytes(), 0, 2);

        assertThat(outputStream.size(), is(3));
        assertThat(outputStream.toString(), is("abc"));
    }