diff options
Diffstat (limited to 'Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/ChunkStream.php')
-rw-r--r-- | Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/ChunkStream.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/ChunkStream.php b/Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/ChunkStream.php new file mode 100644 index 0000000..74c2fbd --- /dev/null +++ b/Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/ChunkStream.php @@ -0,0 +1,39 @@ +<?php + +namespace Http\Message\Encoding; + +/** + * Transform a regular stream into a chunked one. + * + * @author Joel Wurtz <joel.wurtz@gmail.com> + */ +class ChunkStream extends FilteredStream +{ + /** + * {@inheritdoc} + */ + protected function readFilter() + { + return 'chunk'; + } + + /** + * {@inheritdoc} + */ + protected function writeFilter() + { + return 'dechunk'; + } + + /** + * {@inheritdoc} + */ + protected function fill() + { + parent::fill(); + + if ($this->stream->eof()) { + $this->buffer .= "0\r\n\r\n"; + } + } +} |