@Override
    public void append(IApimanBuffer buffer, int offset, int length) {
        int sizeToAppend = length;
        int newBufferSize = this.bytesInBuffer + sizeToAppend;
        if (this.buffer.length >= newBufferSize) {
            System.arraycopy(buffer.getBytes(), offset, this.buffer, bytesInBuffer, sizeToAppend);
        } else {
            byte [] newBuffer = new byte[newBufferSize];
            System.arraycopy(this.buffer, 0, newBuffer, 0, bytesInBuffer);
            System.arraycopy(buffer.getBytes(), offset, newBuffer, bytesInBuffer, sizeToAppend);
            this.buffer = newBuffer;
        }
        this.bytesInBuffer = newBufferSize;
    }
@see io.apiman.gateway.engine.io.IApimanBuffer#append(io.apiman.gateway.engine.io.IApimanBuffer, int, int)
gateway/engine/core/src/main/java/io/apiman/gateway/engine/io/ByteBuffer.java