Sha256: f58ece1a2d34df08cc39c20491e79c94b0ed54c0d8d27e953636cf3e6e76977f

Contents?: true

Size: 292 Bytes

Versions: 19

Compression:

Stored size: 292 Bytes

Contents

module Kafka
  class SnappyCodec
    def initialize
      require "snappy"
    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

19 entries across 19 versions & 1 rubygems

Version Path
ruby-kafka-0.3.13.beta3 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.13.beta2 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.13.beta1 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.12 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.11 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.10 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.9 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.8 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.7 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.6 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.5 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.4 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.3 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.2 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.1 lib/kafka/snappy_codec.rb
ruby-kafka-0.3.0 lib/kafka/snappy_codec.rb
ruby-kafka-0.2.0 lib/kafka/snappy_codec.rb
ruby-kafka-0.1.7 lib/kafka/snappy_codec.rb
ruby-kafka-0.1.6 lib/kafka/snappy_codec.rb