public class JarOutputStream extends ZipOutputStream
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.Manifest,
ZipOutputStreamDEFLATED, STOREDbuf, defoutCENATT, CENATX, CENCOM, CENCRC, CENDSK, CENEXT, CENFLG, CENHDR, CENHOW, CENLEN, CENNAM, CENOFF, CENSIG, CENSIZ, CENTIM, CENVEM, CENVER, ENDCOM, ENDHDR, ENDOFF, ENDSIG, ENDSIZ, ENDSUB, ENDTOT, EXTCRC, EXTHDR, EXTLEN, EXTSIG, EXTSIZ, LOCCRC, LOCEXT, LOCFLG, LOCHDR, LOCHOW, LOCLEN, LOCNAM, LOCSIG, LOCSIZ, LOCTIM, LOCVER| Constructor and Description |
|---|
JarOutputStream(OutputStream out)
Creates a new
JarOutputStream with no manifest. |
JarOutputStream(OutputStream out,
Manifest man)
Creates a new
JarOutputStream with the specified
Manifest. |
| Modifier and Type | Method and Description |
|---|---|
void |
putNextEntry(ZipEntry ze)
Begins writing a new JAR file entry and positions the stream
to the start of the entry data.
|
close, closeEntry, finish, setComment, setLevel, setMethod, writedeflate, writeflush, writepublic JarOutputStream(OutputStream out, Manifest man) throws IOException
JarOutputStream with the specified
Manifest. The manifest is written as the first
entry to the output stream.out - the actual output streamman - the optional ManifestIOException - if an I/O error has occurredpublic JarOutputStream(OutputStream out) throws IOException
JarOutputStream with no manifest.out - the actual output streamIOException - if an I/O error has occurredpublic void putNextEntry(ZipEntry ze) throws IOException
putNextEntry in class ZipOutputStreamze - the ZIP/JAR entry to be writtenZipException - if a ZIP error has occurredIOException - if an I/O error has occurred