@Override
    public void write(IApimanBuffer chunk) {
        if (buffer == null) {
            buffer = bufferFactory.cloneBuffer(chunk);
        } else {
            buffer.append(chunk);
        }
        atEnd = false;
        processBuffer();
    }
@see io.apiman.gateway.engine.io.AbstractStream#write(io.apiman.gateway.engine.io.IApimanBuffer)
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/rewrite/URLRewritingStream.java