Java 1.1 also adds a class to support reading and writing to data streams in compressed format. They are encapsulated into off-the-shelf IO classes to provide compression capabilities.
One of the problems with Java 1.1 is that they are not derived from the new reader and writer classes, but are part of the InputStream and OutputStream hierarchies. So sometimes you have to mix two types of data streams (note that you can easily convert between different types with InputStreamReader and OutputStreamWriter).
Java 1.1 Compression class features
Checkedinputstream Getchecksum () produces checksums for any inputstream (not just decompression)
Checkedoutputstream Getchecksum () produces checksums for any outputstream (not just decompression)
Deflateroutputstream the base class used to compress classes
Zipoutputstream a deflateroutputstream to compress the data into a ZIP file format
Gzipoutputstream a deflateroutputstream to compress the data into a gzip file format
Inflaterinputstream the base class for extracting classes
Zipinputstream a deflaterinputstream to extract data saved in a ZIP file format
Gzipinputstream a Deflaterinputstream, extract data saved in the gzip file format
Although there are many kinds of compression algorithms, zip and gzip may be the most common. So it's easy to use a variety of ready-made tools to read and write compressed data in these formats.