def make_header
      flags = 0
      extra_flags = 0

      flags |= Zlib::GzipFile::FLAG_ORIG_NAME if @orig_name
      flags |= Zlib::GzipFile::FLAG_COMMENT   if @comment

      extra_flags |= Zlib::GzipFile::EXTRAFLAG_FAST if
        @level == Zlib::BEST_SPEED

      extra_flags |= Zlib::GzipFile::EXTRAFLAG_SLOW if
        @level == Zlib::BEST_COMPRESSION

      header = [
        Zlib::GzipFile::MAGIC1,         # byte 0
        Zlib::GzipFile::MAGIC2,         # byte 1
        Zlib::GzipFile::METHOD_DEFLATE, # byte 2
        flags,                          # byte 3
        @mtime.to_i,                    # bytes 4-7
        extra_flags,                    # byte 8
        @os_code                        # byte 9
      ].pack 'CCCCVCC'

      @io.write header

      @io.write "#{@orig_name}\0" if @orig_name
      @io.write "#{@comment}\0" if @comment

      @zstream.flags |= Zlib::GzipFile::HEADER_FINISHED
    end
def make_header
      flags = 0
      extra_flags = 0

      flags |= Zlib::GzipFile::FLAG_ORIG_NAME if @orig_name
      flags |= Zlib::GzipFile::FLAG_COMMENT   if @comment

      extra_flags |= Zlib::GzipFile::EXTRAFLAG_FAST if
        @level == Zlib::BEST_SPEED

      extra_flags |= Zlib::GzipFile::EXTRAFLAG_SLOW if
        @level == Zlib::BEST_COMPRESSION

      header = [
        Zlib::GzipFile::MAGIC1,         # byte 0
        Zlib::GzipFile::MAGIC2,         # byte 1
        Zlib::GzipFile::METHOD_DEFLATE, # byte 2
        flags,                          # byte 3
        @mtime.to_i,                    # bytes 4-7
        extra_flags,                    # byte 8
        @os_code                        # byte 9
      ].pack 'CCCCVCC'

      @io.write header

      @io.write "#{@orig_name}\0" if @orig_name
      @io.write "#{@comment}\0" if @comment

      @zstream.flags |= Zlib::GzipFile::HEADER_FINISHED
    end
Writes out a gzip header