src/Stream/DefaultStream.php
public function readBytes($maxlen = null)
    {
        $this->log->debug('calling readbytes()', array('maxlen' => $maxlen));
        $out = $this->streamReadBytes($this->stream, $maxlen);
        $this->log->debug('readBytes()', [$maxlen, $out]);

        if (false === $out) {
            $meta = $this->streamMeta($this->stream);
            $this->log->warning('stream_get_contents returned false', $meta);
            throw new StreamException(StreamException::OP_READ, 'stream_get_contents returned false');
        }

        return $out;
    }
public function readBytes($maxlen = null)
    {
        $this->log->debug('calling readbytes()', array('maxlen' => $maxlen));
        $out = $this->streamReadBytes($this->stream, $maxlen);
        $this->log->debug('readBytes()', [$maxlen, $out]);

        if (false === $out) {
            $meta = $this->streamMeta($this->stream);
            $this->log->warning('stream_get_contents returned false', $meta);
            throw new StreamException(StreamException::OP_READ, 'stream_get_contents returned false');
        }

        return $out;
    }
public function readBytes ( $ maxlen = null ) { $ this -> log -> debug ( 'calling readbytes()' , array ( 'maxlen' => $ maxlen ) ) ; $ out = $ this -> streamReadBytes ( $ this -> stream , $ maxlen ) ; $ this -> log -> debug ( 'readBytes()' , [ $ maxlen , $ out ] ) ; if ( false === $ out ) { $ meta = $ this -> streamMeta ( $ this -> stream ) ; $ this -> log -> warning ( 'stream_get_contents returned false' , $ meta ) ; throw new StreamException ( StreamException :: OP_READ , 'stream_get_contents returned false' ) ; } return $ out ; }
Read bytes off from the stream.

@param int|null $maxlen

@return string
@throws StreamException If an error occurs while reading from the stream.
Read bytes off from the stream .