src/StringReader.php
public function read($pos, $bytes)
    {
        if ($pos + $bytes > $this->_len) {
            throw new ReaderException('Not enough bytes!');
        }

        return substr($this->_str, $pos, $bytes);
    }
public function read($pos, $bytes)
    {
        if ($pos + $bytes > $this->_len) {
            throw new ReaderException('Not enough bytes!');
        }

        return substr($this->_str, $pos, $bytes);
    }
public function read ( $ pos , $ bytes ) { if ( $ pos + $ bytes > $ this -> _len ) { throw new ReaderException ( 'Not enough bytes!' ) ; } return substr ( $ this -> _str , $ pos , $ bytes ) ; }
Read number of bytes from given offset.

@param int $pos   Offset
@param int $bytes Number of bytes to read

@return string
Read number of bytes from given offset .