Quote:
Originally Posted by stricknyn
Thanks guys,
Also in response to your post jmcilhinney; thank you because that really clarifies some things. In the book this is the exact code sample they used so I was a little confused as to if this compression class was meant to create and read .zip files or really just to compress/decompress text files for transfer.
Strick
|
GZIP is a well-used compression format that, like pretty much any other compression format, works on binary data. You can compress anything you like using GZIP, just as you can with ZIP. The major practical difference between the two is that ZIP files can contain multiple source files where GZIP files can only contain one.
To get around this limitation, most people use the TAR format to combine multiple files into one in an uncompressed format, then compress the TAR file into a GZIP file. Such files normally have a ".tar.gz" or ".tgz" extension and are affectionately known as "tar balls".
The adavantage is that the compression is generally more efficient than the ZIP format. The disadvantage is that you must decompress the entire GZIP file to be able to get one of the source files out of the TAR file, where ZIP files allow you to decompress a single source file.