Sha256: ed496f54fbe5bf46be197a5077e0c01891ed00e766932b9f08f85815ae79137f
Contents?: true
Size: 437 Bytes
Versions: 28
Compression:
Stored size: 437 Bytes
Contents
module Kafka class SnappyCodec def initialize require "snappy" rescue LoadError raise LoadError, "Using snappy compression requires adding a dependency on the `snappy` gem to your Gemfile." end def codec_id 2 end def compress(data) Snappy.deflate(data) end def decompress(data) buffer = StringIO.new(data) Snappy::Reader.new(buffer).read end end end
Version data entries
28 entries across 28 versions & 1 rubygems