src/Stream.php
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}'`).");
        }
    }
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}'`).");
        }
    }
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}'`)." ) ; } }
Throw an exception if a stream is not readable.

@param boolean $bytePerByte Check if the stream is readable byte per byte.
Throw an exception if a stream is not readable .