Here's a sample program that uses the classes found in java.util.zip
to compress one file. Of course, it's possible to compress more than
one file, but I feel that a simple example is best. This program will
compress the argument file in PKZIP-compatible format; it's also possible
to use the GZIP format.
The Source