protected function readBytes($bytes)
    {
        $data = '';
        $chunk = null;
        while ($bytes > 0 && false !== ($chunk = \fread($this->stream, $bytes))) {
            $bytes -= \strlen($chunk);
            $data .= $chunk;
        }

        if (false === $chunk) {
            throw new RuntimeException('Could not read from stream');
        }
        return $data;
    }
protected function readBytes($bytes)
    {
        $data = '';
        $chunk = null;
        while ($bytes > 0 && false !== ($chunk = \fread($this->stream, $bytes))) {
            $bytes -= \strlen($chunk);
            $data .= $chunk;
        }

        if (false === $chunk) {
            throw new RuntimeException('Could not read from stream');
        }
        return $data;
    }
protected function readBytes ( $ bytes ) { $ data = '' ; $ chunk = null ; while ( $ bytes > 0 && false !== ( $ chunk = \ fread ( $ this -> stream , $ bytes ) ) ) { $ bytes -= \ strlen ( $ chunk ) ; $ data .= $ chunk ; } if ( false === $ chunk ) { throw new RuntimeException ( 'Could not read from stream' ) ; } return $ data ; }
Network safe \fread wrapper

@param integer $bytes
@return bool|string
Network safe \ fread wrapper