Skip to content
class method

Zlib::GzipReader.new

(::_Reader io, **untyped opts) -> ::Zlib::GzipReader
Zlib::GzipReader.new(io, options = {})

Creates a GzipReader object associated with io. The GzipReader object reads gzipped data from io, and parses/decompresses it. The io must have a read method that behaves same as the IO#read.

The options hash may be used to set the encoding of the data. :external_encoding, :internal_encoding and :encoding may be set as in IO::new.

If the gzip file header is incorrect, raises an Zlib::GzipFile::Error exception.

See also .open .zcat also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0