Sha256: 2add56b48bffd89f23668297d3ac9145c9008a58ae9783e96bea247c717763dd

Contents?: true

Size: 364 Bytes

Versions: 11

Compression:

Stored size: 364 Bytes

Contents

module Kafka
  class LZ4Codec
    def codec_id
      3
    end

    def load
      require "extlz4"
    rescue LoadError
      raise LoadError, "using lz4 compression requires adding a dependency on the `extlz4` gem to your Gemfile."
    end

    def compress(data)
      LZ4.encode(data)
    end

    def decompress(data)
      LZ4.decode(data)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruby-kafka-0.6.0.beta4 lib/kafka/lz4_codec.rb
ruby-kafka-0.6.0.beta3 lib/kafka/lz4_codec.rb
ruby-kafka-0.6.0.beta2 lib/kafka/lz4_codec.rb
ruby-kafka-0.6.0.beta1 lib/kafka/lz4_codec.rb
ruby-kafka-0.5.5 lib/kafka/lz4_codec.rb
ruby-kafka-0.5.4 lib/kafka/lz4_codec.rb
ruby-kafka-0.5.4.beta1 lib/kafka/lz4_codec.rb
ruby-kafka-0.5.3 lib/kafka/lz4_codec.rb
ruby-kafka-0.5.2 lib/kafka/lz4_codec.rb
ruby-kafka-0.5.2.beta3 lib/kafka/lz4_codec.rb
ruby-kafka-0.5.2.beta2 lib/kafka/lz4_codec.rb