File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 11module Kafka
22 class LZ4Codec
33 def initialize
4- require "lz4-ruby "
4+ require "extlz4 "
55 rescue LoadError
6- raise LoadError , "using lz4 compression requires adding a dependency on the `lz4-ruby ` gem to your Gemfile."
6+ raise LoadError , "using lz4 compression requires adding a dependency on the `extlz4 ` gem to your Gemfile."
77 end
88
99 def codec_id
1010 3
1111 end
1212
1313 def compress ( data )
14- LZ4 :: compress ( data )
14+ LZ4 . encode ( data )
1515 end
1616
1717 def decompress ( data )
18- buffer = StringIO . new ( data )
19- LZ4 ::uncompress ( buffer )
18+ LZ4 . decode ( data )
2019 end
2120 end
2221end
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
3535 spec . add_development_dependency "rspec-benchmark"
3636 spec . add_development_dependency "activesupport"
3737 spec . add_development_dependency "snappy"
38- spec . add_development_dependency "lz4-ruby "
38+ spec . add_development_dependency "extlz4 "
3939 spec . add_development_dependency "colored"
4040 spec . add_development_dependency "rspec_junit_formatter" , "0.2.2"
4141 spec . add_development_dependency "dogstatsd-ruby" , ">= 3.0.0"
You can’t perform that action at this time.
0 commit comments