code: protected function openStream($input)
      {
          if (is_resource($input)) {
              return $input;
          }
  
          if (!is_file($input)) {
              throw new \Exception('File does not exist: ' . $input);
          }
  
          $stream = $this->gzipSupported ? @gzopen($input, 'r') : @fopen($input, 'r');
          if (false === $stream) {
              throw new \Exception('Unable to open file for read: ' . $input);
          }
  
          return $stream;
      }
docs: @param string|resource $input File path or resource
  
  @return resource
  @throws \Exception