public function read($length = null) {

            if(is_null($length))
                $length = $this->getSize(0);

            if (!$this->isReadable() || ($data = fread($this->stream, $length)) === false) {
                throw new \RuntimeException('Could not read from not readable stream');
            }

            return $data;

        }
public function read($length = null) {

            if(is_null($length))
                $length = $this->getSize(0);

            if (!$this->isReadable() || ($data = fread($this->stream, $length)) === false) {
                throw new \RuntimeException('Could not read from not readable stream');
            }

            return $data;

        }
public function read ( $ length = null ) { if ( is_null ( $ length ) ) $ length = $ this -> getSize ( 0 ) ; if ( ! $ this -> isReadable ( ) || ( $ data = fread ( $ this -> stream , $ length ) ) === false ) { throw new \ RuntimeException ( 'Could not read from not readable stream' ) ; } return $ data ; }
Read the stream from the current offset
@param integer       $length         Reading length bytes
@return              string          Returns the stream content
Read the stream from the current offset