What are the practical differences, in terms of performance and functionality, between ZipInputStream/ZipOutputStream and GZIPInputStream/GZIPOutputStream?

Luigi Viggiano

The compression algorithm is the same (Lempel-Ziv derivative LZ-77-deflate). The difference is that GZIP format is used to compress a single file, and ZIP is used to compress many files in a single archive. In Unix world you can find files using GZIP algorithm containing more than 1 file: it's done grouping files with tar utility before, then compressing the stream in a "tar.gz" file (tarball).

If you have to compress a single file, it's better to use GZIP I/O classes, because there isn't multi-file archive handling and shall be faster than ZIP I/O classes. Vice versa, if you have to create an archive of more than 1 file, it's better to use ZIP I/O classes.

For more info, see the zLib homepage.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact