Exercises
Write a small program to compress a file, using java.util.zip. Create an InputStream to read from the source, and a GZIPOutputStream to write the compressed data to. Then, simply copy the data over the two streams. Don’t forget to close the streams!
Now that you compressed a file, write another program to decompress it. You may integrate these two programs into a single program that gets its arguments from the command line (use main’s String[] args).
You may add a GUI to the above application: Create a menu with an option which, in case the user does not specify any command-line arguments, raises a FileDialog that lets the user select which file to compress.