public boolean scan(IApimanBuffer buffer) throws SoapEnvelopeNotFoundException {
        if (this.buffer == null) {
            this.buffer = buffer;
        } else {
            this.buffer.append(buffer);
        }
        boolean scanComplete = doScan();
        // If our buffer is already "max size" but we haven't found the start of the
        // soap envelope yet, then we're likely not going to find it.
        if (!scanComplete && this.buffer.length() >= getMaxBufferLength()) {
            throw new SoapEnvelopeNotFoundException();
        }
        return scanComplete;
    }
Append the given data to any existing buffer, then scan the buffer
looking for the soap headers.  If scanning is complete, this method
will return true.  If more data is required, then the method will return
false.  If an error condition is detected, then an exception will be
thrown.
@param buffer
gateway/engine/core/src/main/java/io/apiman/gateway/engine/soap/SoapHeaderScanner.java