File "ChunkStream.php"
Full Path: /var/www/drive/php-http/message/src/Encoding/ChunkStream.php
File size: 518 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
namespace Http\Message\Encoding;
/**
* Transform a regular stream into a chunked one.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*/
class ChunkStream extends FilteredStream
{
protected function readFilter(): string
{
return 'chunk';
}
protected function writeFilter(): string
{
return 'dechunk';
}
protected function fill(): void
{
parent::fill();
if ($this->stream->eof()) {
$this->buffer .= "0\r\n\r\n";
}
}
}