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.
Basic I/O
Introducing I/O
Output Streams
Input Streams
Data Sources
File Streams
Network Streams
Filter Streams
Filter Streams
Print Streams
Data Streams
Streams in Memory
Compressing Streams
JAR Archives
Cryptographic Streams
Object Serialization
New I/O
Buffers
Channels
Nonblocking I/O
The File System
Working with Files
File Dialogs and Choosers
Text
Character Sets and Unicode
Readers and Writers
Formatted I/O with java.text
Devices
The Java Communications API
USB
The J2ME Generic Connection Framework
Bluetooth
Character Sets