• Uncompession of DEFLATE stream by chunks

    From romeeras@gmail.com@21:1/5 to All on Sat Jul 15 08:55:51 2017
    I'm trying to decompress DEFLATE stream in Ruby by using chunks.
    From what I see in documentation at http://ruby-doc.org/stdlib-2.4.0/libdoc/zlib/rdoc/Zlib/Inflate.html I must read whole stream into memory before unpacking with inflate:

    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

    Do you know way to decode Deflate stream by chunks? Can I do this with Zlib::Inflate or I should use zlib functions directly?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)