3 ms·
GZIP (.gz) and PKZIP (.zip) are both containers for DEFLATE. GZIP is barely a container with minimal metadata, whereas PKZIP supports quite a bit of metadata. A
by zenexer 5y ago
GZIP (.gz) and PKZIP (.zip) are both containers for DEFLATE. GZIP is barely a container with minimal metadata, whereas PKZIP supports quite a bit of metadata. Although you can’t quite concatenate GZIP streams to get a PKZIP file, it’s pretty close—if I recall correctly, you just chop off the GZIP header.
- zenexer 5y agoI'm past the edit period, but: > if I recall correctly, you just chop off the GZIP header. ...to get the raw DEFLATE stream, that is. You still need to attach any necessary metadata for PKZIP, which Max mentions. Their approach for converting between the two is pretty clever: it's so elegant and simple that it seems obvious, but I never would have thought of it. Very nifty, @max_k!