The java.util.jar package, shown in Figure 11-1, contains two stream classes and another half dozen assorted classes and interfaces that assist in reading from and writing to JAR archives. As you can see, almost everything in this package is a subclass of a related class in the java.util.zip package. JAR files are zip files, and they are read and written just like zip files. This package mostly adds support for reading and writing manifests. You don't have to use the java.util.jar package at alljava.util.zip and the standard I/O and string classes are enough to do anything you need to dobut java.util.jar certainly does make your job easier when you need to read manifest entries.
Figure 11-1. The java.util.jar package hierarchy
All of the classes in java.util.jar are used much like their superclasses are. For instance, to read a JAR file, follow these steps:
These are the same six steps you use to read a zip file, only with the java.util.zip classes replaced by their counterparts in java.util.jar.
Streams in Memory
The File System
Working with Files
File Dialogs and Choosers
Character Sets and Unicode
Readers and Writers
Formatted I/O with java.text
The Java Communications API
The J2ME Generic Connection Framework