Пример #1
0
 public function close()
 {
     if ($this->m_stream == null) {
         return;
     }
     try {
         $this->m_stream->close();
     } catch (IOException $e) {
     }
     $this->reset(null, false);
 }
 /**
  * Reads stream contents
  *
  * @param   io.streams.InputStream is
  * @return  string bytes
  */
 protected function readAll(InputStream $is)
 {
     for ($contents = ''; $is->available();) {
         $contents .= $is->read();
     }
     $is->close();
     return $contents;
 }
Пример #3
0
function reader(InputStream $stream)
{
    foreach ($stream as $line) {
        if (strlen($line)) {
            (yield $line);
        } else {
            $stream->close();
        }
    }
}
Пример #4
0
 /**
  * Close the stream.
  */
 public function close()
 {
     return $this->inStream->close();
 }
Пример #5
0
 /**
  * Closes the input.
  */
 public function close()
 {
     $this->stream->close();
 }