Compression
The Java I/O library contains classes to support reading and writing streams in a compressed format. These are wrapped around existing I/O classes to provide compression functionality.
These classes are not derived from the Reader and Writer classes, but instead are part of the InputStream and OutputStream hierarchies. This is because the compression library works with bytes, not characters. However, you might sometimes be forced to mix the two types of streams. (Remember that you can use InputStreamReader and OutputStreamWriter to provide easy conversion between one type and another.)
Compression class
|
Function
|
CheckedInputStream
|
GetCheckSum( ) produces checksum for any InputStream (not just decompression).
|
CheckedOutputStream
|
GetCheckSum( ) produces checksum for any OutputStream (not just compression).
|
DeflaterOutputStream
|
Base class for compression classes.
|
ZipOutputStream
|
A DeflaterOutputStream that compresses data into the Zip file format.
|
GZIPOutputStream
|
A DeflaterOutputStream that compresses data into the GZIP file format.
|
InflaterInputStream
|
Base class for decompression classes.
|
ZipInputStream
|
An InflaterInputStream that decompresses data that has been stored in the Zip file format.
|
GZIPInputStream
|
An InflaterInputStream that decompresses data that has been stored in the GZIP file format.
|
Although there are many compression algorithms, Zip and GZIP are possibly the most commonly used. Thus you can easily manipulate your compressed data with the many tools available for reading and writing these formats.