def eof?
      fail IOError, "closed stream" if closed?

      return false if cache && !cache.eof?
      @buffer.nil? && chunks_depleted?
    end
def eof?
      fail IOError, "closed stream" if closed?

      return false if cache && !cache.eof?
      @buffer.nil? && chunks_depleted?
    end
Implements IO#eof? semantics. Returns whether we've reached end of file.
 It returns true if cache is at the end and there is no more content to
 retrieve. Raises IOError if closed.