original_string: protected function _ensureReadable($bytePerByte = true)
      {
          if (!$this->valid()) {
              throw new RuntimeException('Cannot read from a closed stream.');
          }
          if (!$this->isReadable()) {
              $mode = $this->meta('mode');
              throw new RuntimeException("Cannot read on a non-readable stream (mode is `'{$mode}'`).");
          }
      }
code: protected function _ensureReadable($bytePerByte = true)
      {
          if (!$this->valid()) {
              throw new RuntimeException('Cannot read from a closed stream.');
          }
          if (!$this->isReadable()) {
              $mode = $this->meta('mode');
              throw new RuntimeException("Cannot read on a non-readable stream (mode is `'{$mode}'`).");
          }
      }
code_tokens: protected function _ensureReadable ( $ bytePerByte = true ) { if ( ! $ this -> valid ( ) ) { throw new RuntimeException ( 'Cannot read from a closed stream.' ) ; } if ( ! $ this -> isReadable ( ) ) { $ mode = $ this -> meta ( 'mode' ) ; throw new RuntimeException ( "Cannot read on a non-readable stream (mode is `'{$mode}'`)." ) ; } }
docstring: Throw an exception if a stream is not readable.
  
  @param boolean $bytePerByte Check if the stream is readable byte per byte.
docstring_tokens: Throw an exception if a stream is not readable .