Parse the gzip header (assuming we're in the appropriate state).
In order to deal with degenerate cases (e.g., user buffer is one byte
long), we copy (some) header bytes to another buffer. (Filename,
comment, and extra-field bytes are simply skipped.)
See http://www.ietf.org/rfc/rfc1952.txt for the gzip spec. Note that
no version of gzip to date (at least through 1.4.0, 2010-01-20) supports
the FHCRC header-CRC16 flagbit; instead, the implementation treats it
as a multi-file continuation flag (which it also doesn't support). :-(
Sun's JDK v6 (1.6) supports the header CRC, however, and so do we.