Answer the question
In order to leave comments, you need to log in
How to decompress deflated in chunks in Ruby?
According to the example in the Zlib::Inflate Ruby documentation
open "compressed.file" do |compressed_io|
zi = Zlib::Inflate.new(Zlib::MAX_WBITS + 32)
begin
open "uncompressed.file", "w+" do |uncompressed_io|
uncompressed_io << zi.inflate(compressed_io.read)
end
ensure
zi.close
end
end
compressed_io.read
that the entire contents of the file are read as the passed argument. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question