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; }
function reader(InputStream $stream) { foreach ($stream as $line) { if (strlen($line)) { (yield $line); } else { $stream->close(); } } }
/** * Close the stream. */ public function close() { return $this->inStream->close(); }
/** * Closes the input. */ public function close() { $this->stream->close(); }