From: Ueno Katsuhiro Date: 2001-10-08T21:52:49+09:00 Subject: [ruby-talk:22233] Re: gzip a string Hi, On Mon, 8 Oct 2001 21:27:52 +0900 Tobias Reif wrote: > How can I make the following work? > I try to gzip a string, then unzip it: You must finish the deflate stream if you want the whole of compressed data. Try the following code: require 'zlib' initial_string = "Tobi\n" defl = Deflate.new infl = Inflate.new deflated = defl.deflate(initial_string) + defl.finish print deflated restored_string = infl.inflate(deflated) print restored_string or simply; deflated = Deflate.deflate(initial_string) -- ---- - - - -- - UENO Katsuhiro