Sha256: b5ab2624e25615cd2a72c968f7a14dc70cc9db0aa5a7b9622d5b3c86746e5905
Contents?: true
Size: 518 Bytes
Versions: 47
Compression:
Stored size: 518 Bytes
Contents
module Kafka class GzipCodec def initialize require "zlib" end def codec_id 1 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
47 entries across 47 versions & 1 rubygems