From: Jos Backus Date: 2011-02-04T06:57:56+09:00 Subject: Re: Zlib::GzipReader and multiple compressed blobs in a single stream On Thu, Feb 03, 2011 at 02:03:49PM +0900, Jeremy Bopp wrote: > Once your fix is in place and GZipReader#unused works correctly, is > there any convenient way to take the returned string and continue > processing it along with the remaining file contents with an instance of > GzipReader? Fwiw, with the changes just committed to trunk the following code works for me on a file with multiple gzipped blobs: require 'stringio' require 'zlib' def inflate(filename) File.open(filename) do |file| zio = StringIO.new(file.read) loop do io = Zlib::GzipReader.new zio puts io.read unused = io.unused io.finish break if unused.nil? zio.pos -= unused.length end end end inflate "gz" Thanks, Jos -- Jos Backus jos at catnook.com