1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-26 20:04:51 +01:00

Add Parser::getBuffer()

This commit is contained in:
Niklas Keller 2017-05-22 08:34:38 +02:00
parent 7a20d5b177
commit 253aaaf4fa

View File

@ -46,6 +46,16 @@ class Parser implements OutputStream {
}
}
/**
* Allows inspecting the current buffer. This might be required to get the remaining buffer data in case an input
* stream ends and there's still something in the buffer.
*
* @return string
*/
public function getBuffer(): string {
return $this->buffer;
}
/**
* Cancels the generator parser and returns any remaining data in the internal buffer. Writing data after calling
* this method will result in an error.