src/Stream.php
public function read($length)
    {
        if ($length < 1) {
            return '';
        }

        $buffer = fread($this->stream, $length);

        if ($buffer === false) {
            throw new RuntimeException('Failed to read ' . $length . ' bytes');
        }

        return $buffer;
    }
public function read($length)
    {
        if ($length < 1) {
            return '';
        }

        $buffer = fread($this->stream, $length);

        if ($buffer === false) {
            throw new RuntimeException('Failed to read ' . $length . ' bytes');
        }

        return $buffer;
    }
public function read ( $ length ) { if ( $ length < 1 ) { return '' ; } $ buffer = fread ( $ this -> stream , $ length ) ; if ( $ buffer === false ) { throw new RuntimeException ( 'Failed to read ' . $ length . ' bytes' ) ; } return $ buffer ; }
Read data from the stream

@param int $length

@return string
Read data from the stream