lib/archive/support/zlib.rb
def unbuffered_seek(offset, whence = IO::SEEK_SET)
      unless offset == 0 &&
             ((whence == IO::SEEK_SET && delegate.respond_to?(:rewind)) ||
              whence == IO::SEEK_CUR) then
        raise Errno::EINVAL
      end

      case whence
      when IO::SEEK_SET
        delegate.rewind
        @deflater.finish
        @deflater.close
        @deflater = Zlib::Deflate.new(
          @level, @window_bits, @mem_level, @strategy
        )
        @deflate_buffer = ''
        0
      when IO::SEEK_CUR
        @deflater.total_in
      end
    end
def unbuffered_seek(offset, whence = IO::SEEK_SET)
      unless offset == 0 &&
             ((whence == IO::SEEK_SET && delegate.respond_to?(:rewind)) ||
              whence == IO::SEEK_CUR) then
        raise Errno::EINVAL
      end

      case whence
      when IO::SEEK_SET
        delegate.rewind
        @deflater.finish
        @deflater.close
        @deflater = Zlib::Deflate.new(
          @level, @window_bits, @mem_level, @strategy
        )
        @deflate_buffer = ''
        0
      when IO::SEEK_CUR
        @deflater.total_in
      end
    end
Allows resetting this object and the delegate object back to the beginning
 of the stream or reporting the current position in the stream.

 Raises Errno::EINVAL unless _offset_ is <tt>0</tt> and _whence_ is either
 IO::SEEK_SET or IO::SEEK_CUR.  Raises Errno::EINVAL if _whence_ is
 IO::SEEK_SEK and the delegate object does not respond to the _rewind_
 method.