code: def close
        flush()
        @deflate_buffer << @deflater.finish unless @deflater.finished?
        begin
          until @deflate_buffer.empty? do
            @deflate_buffer.slice!(0, delegate.write(@deflate_buffer))
          end
        rescue Errno::EAGAIN, Errno::EINTR
          retry if write_ready?
        end
        @checksum = @deflater.adler
        @compressed_size = @deflater.total_out
        @uncompressed_size = @deflater.total_in
        @deflater.close
        super()
        nil
      end
docs: Closes the writer by finishing the compressed data and flushing it to the
   delegate.
  
   Raises IOError if called more than once.