Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #7364
| X-Received | by 10.99.232.83 with SMTP id a19mr13389678pgk.127.1500134152066; Sat, 15 Jul 2017 08:55:52 -0700 (PDT) |
|---|---|
| X-Received | by 10.36.125.65 with SMTP id b62mr58205itc.5.1500134151950; Sat, 15 Jul 2017 08:55:51 -0700 (PDT) |
| Path | csiph.com!feeder.erje.net!2.us.feeder.erje.net!feeder.usenetexpress.com!feeder1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!v202no1034646itb.0!news-out.google.com!f200ni5741itc.0!nntp.google.com!v202no1034643itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.ruby |
| Date | Sat, 15 Jul 2017 08:55:51 -0700 (PDT) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=77.125.6.87; posting-account=Dig0aQoAAAAMSbE8tI8hxn0-1tNHIKtA |
| NNTP-Posting-Host | 77.125.6.87 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <fecd0324-a6a0-4278-a2bc-e36aa066498b@googlegroups.com> (permalink) |
| Subject | Uncompession of DEFLATE stream by chunks |
| From | romeeras@gmail.com |
| Injection-Date | Sat, 15 Jul 2017 15:55:52 +0000 |
| Content-Type | text/plain; charset="UTF-8" |
| Lines | 15 |
| Xref | csiph.com comp.lang.ruby:7364 |
Show key headers only | View raw
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?
Back to comp.lang.ruby | Previous | Next | Find similar
Uncompession of DEFLATE stream by chunks romeeras@gmail.com - 2017-07-15 08:55 -0700
csiph-web