gzip_header

Function read_gz_header

Source
pub fn read_gz_header<R: Read>(r: &mut R) -> Result<GzHeader>
Expand description

Try to read a gzip header from the provided reader.

Returns a GzHeader with the fields filled out if sucessful, or an io::Error with ErrorKind::InvalidInput if decoding of the header.

Note that a gzip steam can contain multiple “members”. Each member contains a header, followed by compressed data and finally a checksum and byte count. This method will only read the header for the “member” at the start of the stream.