JarOutputStream class is used to write the contents
of a JAR file to any output stream. It extends the class
java.util.zip.ZipOutputStream with support
for writing an optional Manifest entry. The
Manifest can be used to specify meta-information about
the JAR file and its entries.
Unless otherwise noted, passing a null argument to a constructor
or method in this class will cause a NullPointerException to be
thrown.
Manifest, java.util.zip.ZipOutputStream
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | JarOutputStream(OutputStream
the actual output stream out, Manifest the optional man)ManifestCreates a new |
| public | JarOutputStream(OutputStream
the actual output stream out)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private static int | |
| private static boolean | |
| public void | putNextEntry(ZipEntry
the ZIP/JAR entry to be written ze)Overrides java. Begins writing a new JAR file entry and positions the stream to the start of the entry data. |
| private static void |
| firstEntry | back to summary |
|---|---|
| private boolean firstEntry | |
| JAR_MAGIC | back to summary |
|---|---|
| private static final int JAR_MAGIC | |
| JarOutputStream | back to summary |
|---|---|
| public JarOutputStream(OutputStream out, Manifest man) throws IOException Creates a new
| |
| JarOutputStream | back to summary |
|---|---|
| public JarOutputStream(OutputStream out) throws IOException Creates a new
| |
| get16 | back to summary |
|---|---|
| private static int get16(byte[] b, int off) | |
| hasMagic | back to summary |
|---|---|
| private static boolean hasMagic(byte[] edata) | |
| putNextEntry | back to summary |
|---|---|
| public void putNextEntry(ZipEntry ze) throws IOException Overrides java. Begins writing a new JAR file entry and positions the stream to the start of the entry data. This method will also close any previous entry.
The default compression method will be used if no compression
method was specified for the entry. When writing a compressed
(DEFLATED) entry, and the compressed size has not been explicitly
set with the The current time will be used if the entry has no set modification time.
| |
| set16 | back to summary |
|---|---|
| private static void set16(byte[] b, int off, int value) | |