public function read($bytesRequested)
    {
      $len = strlen($this->_sourceString);
      if($this->_bytesRead == $len) {
          return FALSE;
      } else if($bytesRequested > $len - $this->_bytesRead) {
          $bytesRequested = $len - $this->_bytesRead;
      }

      $buffer = substr($this->_sourceString, $this->_bytesRead, $bytesRequested);
      $this->_bytesRead += $bytesRequested;

      return $buffer;
    }
public function read($bytesRequested)
    {
      $len = strlen($this->_sourceString);
      if($this->_bytesRead == $len) {
          return FALSE;
      } else if($bytesRequested > $len - $this->_bytesRead) {
          $bytesRequested = $len - $this->_bytesRead;
      }

      $buffer = substr($this->_sourceString, $this->_bytesRead, $bytesRequested);
      $this->_bytesRead += $bytesRequested;

      return $buffer;
    }
public function read ( $ bytesRequested ) { $ len = strlen ( $ this -> _sourceString ) ; if ( $ this -> _bytesRead == $ len ) { return FALSE ; } else if ( $ bytesRequested > $ len - $ this -> _bytesRead ) { $ bytesRequested = $ len - $ this -> _bytesRead ; } $ buffer = substr ( $ this -> _sourceString , $ this -> _bytesRead , $ bytesRequested ) ; $ this -> _bytesRead += $ bytesRequested ; return $ buffer ; }
Read the next chunk of the string.

@param integer $bytesRequested The size of the chunk that is to be read.
@return string A corresponding piece of the string.
Read the next chunk of the string .