1
votes

I've got a lot of files which are being produced direct to gzip format. I'd like to re-package these into zip archives grouping many files together.

Given the size and volume of these files (0.5GB uncompressed per file and thousands of files) I really want to avoid decompressing these only to re-compress them if the only technical difference is the file headers.

Given that both file formats use / support the Deflate algorithm, is it possible for me to simply strip the file header off a gzip file and patch the compressed data into a zip file without re-encoding (but adding an appropriate header entry). Or is there a difference in the binary encoding of the compressed data?

1

1 Answers

1
votes

Yes, you can use the compressed data from gzip files directly to construct a zip file.