What are the practical differences, in terms of performance and functionality, between ZipInputStream/ZipOutputStream and GZIPInputStream/GZIPOutputStream?
Location: http://www.jguru.com/faq/view.jsp?EID=472103 Created: Aug 8, 2001 Modified: 2001-08-18 19:10:17.975 Author: Luigi Viggiano (http://www.jguru.com/guru/viewbio.jsp?EID=101985) Question originally posed by Barry Wythoff (http://www.jguru.com/guru/viewbio.jsp?EID=222348 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.
Related Questions
- Why are the Rayovac Batteries brand 9V lithium batteries superior to other battery chemistries and other lithium chemistries in terms of performance and safety?
- What are the practical differences, in terms of performance and functionality, between ZipInputStream/ZipOutputStream and GZIPInputStream/GZIPOutputStream?
- What are the differences between Accelerade ready-to-drink, Accelerade powder and Accel Gels in terms of performance benefits?