Be careful of the footer of the gzip file. A gzip file has the checksum of
pre-compressed data in its footer. GzipReader
checks all uncompressed data against that checksum at the following cases,
and if it fails, raises Zlib::GzipFile::NoFooter,
Zlib::GzipFile::CRCError, or
Zlib::GzipFile::LengthError exception.

When an reading request is received beyond the end of file (the end of
compressed data). That is, when #read, #gets, or some other methods for
reading returns nil.

When #unused method is called
after the object reaches the end of file.

The rest of the methods are adequately described in their own
documentation.

Public Class Methods

Zlib::GzipReader.new(io)click to toggle source

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

Reads at most maxlen bytes from the gziped stream but it blocks
only if gzipreader has no data immediately available. If the
optional outbuf argument is present, it must reference a String,
which will receive the data. It raises EOFError on end of
file.