@Override
    public void write(byte[] b, int off, int len) throws IOException {
        checkPreBufferSize(len);

        if (postBuffer != null) {
            postBuffer.write(b, off, len);
        } else {
            System.arraycopy(b, off, preBuffer, preBufferPos, len);
            preBufferPos = preBufferPos + len;
        }
    }
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