protected function closeStream() { if (is_resource($this->stream)) { @fclose($this->stream); $this->stream = null; } }