1 # Part of the zip-doc suite
2 # By Stian Haklev (shaklev@gmail.com), 2007
3 # Released under MIT and GPL licenses
5 # Provides compression and uncompression features for zipdoc program. Can be transparently
6 # exchanged with other compression methods, as long as the same is used for packing and
7 # accessing (unpacking). Must operate so that each chunk can be independently unpacked.
12 def self.uncompress(txt)
13 BZ2::Reader.new(txt).read
16 def self.compress(txt)
17 (BZ2::Writer.new << txt).flush