JarOutputStream is a subclass of ZipOutputStream.
public class JarOutputStream extends ZipOutputStream
You can specify a manifest for the archive in the constructor, but this is optional. If you don't provide a manifest, none is written onto the stream:
public JarOutputStream(OutputStream out, Manifest man) throws IOException public JarOutputStream(OutputStream out) throws IOException
This class is even closer to ZipOutputStream than JarInputStream is to ZipInputStream. It overrides exactly one method, putNextEntry( ):
public void putNextEntry(ZipEntry ze) throws IOException
This is done in order to store the JAR magic number with each entry, but you don't need to know this. Other than the constructor invocation, you use this class exactly like you use ZipOutputStream.
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