File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
module Kafka
2
2
class LZ4Codec
3
3
def initialize
4
- require "lz4-ruby "
4
+ require "extlz4 "
5
5
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."
7
7
end
8
8
9
9
def codec_id
10
10
3
11
11
end
12
12
13
13
def compress ( data )
14
- LZ4 :: compress ( data )
14
+ LZ4 . encode ( data )
15
15
end
16
16
17
17
def decompress ( data )
18
- buffer = StringIO . new ( data )
19
- LZ4 ::uncompress ( buffer )
18
+ LZ4 . decode ( data )
20
19
end
21
20
end
22
21
end
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
spec . add_development_dependency "rspec-benchmark"
36
36
spec . add_development_dependency "activesupport"
37
37
spec . add_development_dependency "snappy"
38
- spec . add_development_dependency "lz4-ruby "
38
+ spec . add_development_dependency "extlz4 "
39
39
spec . add_development_dependency "colored"
40
40
spec . add_development_dependency "rspec_junit_formatter" , "0.2.2"
41
41
spec . add_development_dependency "dogstatsd-ruby" , ">= 3.0.0"
You can’t perform that action at this time.
0 commit comments