@Override
    public void write(int b) throws IOException {
        checkPreBufferSize(1);

        if (postBuffer != null) {
            postBuffer.write(b);
        } else {
            preBuffer[preBufferPos] = (byte) b;
            preBufferPos++;
        }
    }
An output stream buffer that tries to use a given buffer first and once that
is not big enough it delegates all calls to a real ByteArrayOutputStream.
<p>
It also allows access to the buffer and pos without a copy of the array.
stroom-util/src/main/java/stroom/util/io/InitialByteArrayOutputStream.java