protected function sendBody(Stream $body)
    {
        // I don't trust that this will be at the beginning of the stream, so reset.
        $body->rewind();

        // writing to an arbitrary stream.
        // @todo Use stream operations to make this more robust and allow
        $bytes = 0;
        if ($bytes = $body->getSize() && $bytes < 500) {
            print $body->getContents();

        } else {
            while (!$body->eof()) {
                $data = $body->read(1024);
                print $data;
            }
        }
    }
protected function sendBody(Stream $body)
    {
        // I don't trust that this will be at the beginning of the stream, so reset.
        $body->rewind();

        // writing to an arbitrary stream.
        // @todo Use stream operations to make this more robust and allow
        $bytes = 0;
        if ($bytes = $body->getSize() && $bytes < 500) {
            print $body->getContents();

        } else {
            while (!$body->eof()) {
                $data = $body->read(1024);
                print $data;
            }
        }
    }
protected function sendBody ( Stream $ body ) { // I don't trust that this will be at the beginning of the stream, so reset. $ body -> rewind ( ) ; // writing to an arbitrary stream. // @todo Use stream operations to make this more robust and allow $ bytes = 0 ; if ( $ bytes = $ body -> getSize ( ) && $ bytes < 500 ) { print $ body -> getContents ( ) ; } else { while ( ! $ body -> eof ( ) ) { $ data = $ body -> read ( 1024 ) ; print $ data ; } } }
Sends Body.

@param Psr\Http\Message\StreamInterface $body The body to send as stream

@author Benjamin Carl <opensource@clickalicious.de>
@return void
@access protected
Sends Body .