Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Zlib::GzipReader.zcat

Zlib::GzipReader.zcat(io, options = {}, &block) => nil
Zlib::GzipReader.zcat(io, options = {}) => string

Decompresses all gzip data in the io, handling multiple gzip streams until the end of the io. There should not be any non-gzip data after the gzip streams.

If a block is given, it is yielded strings of uncompressed data, and the method returns nil. If a block is not given, the method returns the concatenation of all uncompressed data in all gzip streams.

See also .open #each .new #each_byte also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0