start page | rating of books | rating of authors | reviews | copyrights

Java Fundamental Classes Reference

Previous Chapter 1

1.8 The Package

The package is new in Java 1.1. It contains classes that provide support for general-purpose data compression and decompression using the ZLIB compression algorithms. The important classes in are those that provide the means to read and write data that is compatible with the popular GZIP and ZIP formats: GZIPInputStream, GZIPOutputStream, ZipInputStream, and ZipOutputStream.

The GZIP and ZIP classes are easy to use because they subclass FilterInputStream and While a GZIP file is simply a stream of compressed data, a ZIP file, or archive, can contain multiple compressed files. A ZipEntry object represents each compressed file in the archive. The ZipFile class is provided as a convenience for reading an archive; it allows nonsequential access to the entries in a ZIP file while the ZipInputStream class provides only sequential access.

The remainder of the classes in support the GZIP and ZIP classes. The generic Deflater and Inflater classes implement the ZLIB algorithms; they are used by DeflaterOutputStream and InflaterInputStream to decompress and compress data. The Checksum interface and the classes that implement it, Adler32 and CRC32, define algorithms that generate checksums from stream data. These checksums are used by the CheckedInputStream and CheckedOutputStream classes.

See Chapter 18, The Package, for complete reference material on all of the classes in the package.

Previous Home Next
The java.math Package Book Index Strings and Related Classes

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java