Class: LZMA

Inherits:
Object
  • Object
show all
Defined in:
lib/lzma.rb,
lib/lzma.rb,
ext/lzma_ruby.cpp

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLZMA

Returns a new instance of LZMA.



11
12
13
# File 'lib/lzma.rb', line 11

def initialize
  @lzma = com.ephemeronindustries.lzma.LZMA.new
end

Class Method Details

.compress(data) ⇒ Object



29
30
31
# File 'lib/lzma.rb', line 29

def self.compress(data)
  LZMA.new.compress(data)
end

.decompress(data) ⇒ Object



26
27
28
# File 'lib/lzma.rb', line 26

def self.decompress(data)
  LZMA.new.decompress(data)
end

Instance Method Details

#compress(data) ⇒ Object



15
16
17
# File 'lib/lzma.rb', line 15

def compress(data)
  String.from_java_bytes @lzma.compress(data.to_java_bytes)
end

#decompress(data) ⇒ Object



19
20
21
# File 'lib/lzma.rb', line 19

def decompress(data)
  String.from_java_bytes @lzma.decompress(data.to_java_bytes)
end