fuc-new/vendor/php-http/message/src/Encoding/ChunkStream.php
hellcat 1fe8673f62 1
2025-10-01 13:34:29 +08:00

31 lines
518 B
PHP
Executable File

<?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";
}
}
}