Creating a gzip stream
During compression, the selected file is treated as one byte stream. Gzip places a DEFLATE-compressed representation inside a gzip member, with a header before it and a trailer after it. The trailer records a CRC-32 value and the original byte count modulo 2^32. These fields let a decoder detect many forms of damaged or incomplete gzip data.