Sha256: 8660c6816f814fb095d4dc3bbdadad21fd0a7e3bab8f758cb7f5391aaf202e29
Contents?: true
Size: 512 Bytes
Versions: 11
Compression:
Stored size: 512 Bytes
Contents
module Kafka class GzipCodec def codec_id 1 end def load require "zlib" end 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 def decompress(data) buffer = StringIO.new(data) reader = Zlib::GzipReader.new(buffer) reader.read end end end
Version data entries
11 entries across 11 versions & 1 rubygems