src/Http/Message.php
public function toChunks($size = null)
    {
        $body = '';
        $size = $size > 0 ? $size : $this->chunkSize();
        $stream = $this->stream();
        while($chunk = $stream->read($size)) {
            $readed = strlen($chunk);
            if (!$readed) {
                break;
            }
            $body .= dechex($readed) . "\r\n" . $chunk . "\r\n";
        }
        $body .= "0\r\n\r\n";

        if ($stream->isSeekable()) {
            $stream->rewind();
        }
        return $body;
    }
public function toChunks($size = null)
    {
        $body = '';
        $size = $size > 0 ? $size : $this->chunkSize();
        $stream = $this->stream();
        while($chunk = $stream->read($size)) {
            $readed = strlen($chunk);
            if (!$readed) {
                break;
            }
            $body .= dechex($readed) . "\r\n" . $chunk . "\r\n";
        }
        $body .= "0\r\n\r\n";

        if ($stream->isSeekable()) {
            $stream->rewind();
        }
        return $body;
    }
public function toChunks ( $ size = null ) { $ body = '' ; $ size = $ size > 0 ? $ size : $ this -> chunkSize ( ) ; $ stream = $ this -> stream ( ) ; while ( $ chunk = $ stream -> read ( $ size ) ) { $ readed = strlen ( $ chunk ) ; if ( ! $ readed ) { break ; } $ body .= dechex ( $ readed ) . "\r\n" . $ chunk . "\r\n" ; } $ body .= "0\r\n\r\n" ; if ( $ stream -> isSeekable ( ) ) { $ stream -> rewind ( ) ; } return $ body ; }
Flush the content of a Message chunk by chunk.

@param Closure $size The size of the chunks to process.
Flush the content of a Message chunk by chunk .