You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gzip_codec.rb
    path of file: ./repos/ruby-kafka/lib/kafka
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Kafka
  class GzipCodec
    def codec_id
      1
    end

    def produce_api_min_version
      0
    end

    def load
      require "zlib"
    end

    def compress(data)
     
    
    def compress(data)
      buffer = StringIO.new
      buffer.set_encoding(Encoding::BINARY)

      writer = Zlib::GzipWriter.new(buffer, Zlib::DEFAULT_COMPRESSION, Zlib::DEFAULT_STRATEGY)
      writer.write(data)
      writer.close

      buffer.string
    end