Sha256: 0adf44ec29234168f650000fcef1df4772d1c1fa752cb1a29f41431d57aa246c
Contents?: true
Size: 431 Bytes
Versions: 11
Compression:
Stored size: 431 Bytes
Contents
module Kafka class SnappyCodec def codec_id 2 end def load require "snappy" rescue LoadError raise LoadError, "Using snappy compression requires adding a dependency on the `snappy` gem to your Gemfile." 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
11 entries across 11 versions & 1 rubygems