java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.util.zip.DeflaterOutputStream
java.util.zip.ZipOutputStream
java.util.jar.JarOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
public class JarOutputStream extends ZipOutputStream
The 
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.- Since:
- 1.2
- See Also:
- Manifest,- ZipOutputStream
- 
Field SummaryFields Modifier and Type Field Description static intCENATTstatic intCENATXstatic intCENCOMstatic intCENCRCstatic intCENDSKstatic intCENEXTstatic intCENFLGstatic intCENHDRstatic intCENHOWstatic intCENLENstatic intCENNAMstatic intCENOFFstatic longCENSIGstatic intCENSIZstatic intCENTIMstatic intCENVEMstatic intCENVERstatic intENDCOMstatic intENDHDRstatic intENDOFFstatic longENDSIGstatic intENDSIZstatic intENDSUBstatic intENDTOTstatic intEXTCRCstatic intEXTHDRstatic intEXTLENstatic longEXTSIGstatic intEXTSIZstatic intLOCCRCstatic intLOCEXTstatic intLOCFLGstatic intLOCHDRstatic intLOCHOWstatic intLOCLENstatic intLOCNAMstatic longLOCSIGstatic intLOCSIZstatic intLOCTIMstatic intLOCVER
- 
Constructor SummaryConstructors Constructor Description JarOutputStream(OutputStream out)Creates a newJarOutputStreamwith no manifest.JarOutputStream(OutputStream out, Manifest man)Creates a newJarOutputStreamwith the specifiedManifest.
- 
Method SummaryModifier and Type Method Description voidputNextEntry(ZipEntry ze)Begins writing a new JAR file entry and positions the stream to the start of the entry data.Methods declared in class java.util.zip.ZipOutputStreamclose, closeEntry, finish, setComment, setLevel, setMethod, write
- 
Field Details- 
LOCSIGpublic static final long LOCSIG- See Also:
- Constant Field Values
 
- 
EXTSIGpublic static final long EXTSIG- See Also:
- Constant Field Values
 
- 
CENSIGpublic static final long CENSIG- See Also:
- Constant Field Values
 
- 
ENDSIGpublic static final long ENDSIG- See Also:
- Constant Field Values
 
- 
LOCHDRpublic static final int LOCHDR- See Also:
- Constant Field Values
 
- 
EXTHDRpublic static final int EXTHDR- See Also:
- Constant Field Values
 
- 
CENHDRpublic static final int CENHDR- See Also:
- Constant Field Values
 
- 
ENDHDRpublic static final int ENDHDR- See Also:
- Constant Field Values
 
- 
LOCVERpublic static final int LOCVER- See Also:
- Constant Field Values
 
- 
LOCFLGpublic static final int LOCFLG- See Also:
- Constant Field Values
 
- 
LOCHOWpublic static final int LOCHOW- See Also:
- Constant Field Values
 
- 
LOCTIMpublic static final int LOCTIM- See Also:
- Constant Field Values
 
- 
LOCCRCpublic static final int LOCCRC- See Also:
- Constant Field Values
 
- 
LOCSIZpublic static final int LOCSIZ- See Also:
- Constant Field Values
 
- 
LOCLENpublic static final int LOCLEN- See Also:
- Constant Field Values
 
- 
LOCNAMpublic static final int LOCNAM- See Also:
- Constant Field Values
 
- 
LOCEXTpublic static final int LOCEXT- See Also:
- Constant Field Values
 
- 
EXTCRCpublic static final int EXTCRC- See Also:
- Constant Field Values
 
- 
EXTSIZpublic static final int EXTSIZ- See Also:
- Constant Field Values
 
- 
EXTLENpublic static final int EXTLEN- See Also:
- Constant Field Values
 
- 
CENVEMpublic static final int CENVEM- See Also:
- Constant Field Values
 
- 
CENVERpublic static final int CENVER- See Also:
- Constant Field Values
 
- 
CENFLGpublic static final int CENFLG- See Also:
- Constant Field Values
 
- 
CENHOWpublic static final int CENHOW- See Also:
- Constant Field Values
 
- 
CENTIMpublic static final int CENTIM- See Also:
- Constant Field Values
 
- 
CENCRCpublic static final int CENCRC- See Also:
- Constant Field Values
 
- 
CENSIZpublic static final int CENSIZ- See Also:
- Constant Field Values
 
- 
CENLENpublic static final int CENLEN- See Also:
- Constant Field Values
 
- 
CENNAMpublic static final int CENNAM- See Also:
- Constant Field Values
 
- 
CENEXTpublic static final int CENEXT- See Also:
- Constant Field Values
 
- 
CENCOMpublic static final int CENCOM- See Also:
- Constant Field Values
 
- 
CENDSKpublic static final int CENDSK- See Also:
- Constant Field Values
 
- 
CENATTpublic static final int CENATT- See Also:
- Constant Field Values
 
- 
CENATXpublic static final int CENATX- See Also:
- Constant Field Values
 
- 
CENOFFpublic static final int CENOFF- See Also:
- Constant Field Values
 
- 
ENDSUBpublic static final int ENDSUB- See Also:
- Constant Field Values
 
- 
ENDTOTpublic static final int ENDTOT- See Also:
- Constant Field Values
 
- 
ENDSIZpublic static final int ENDSIZ- See Also:
- Constant Field Values
 
- 
ENDOFFpublic static final int ENDOFF- See Also:
- Constant Field Values
 
- 
ENDCOMpublic static final int ENDCOM- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
JarOutputStreamCreates a newJarOutputStreamwith the specifiedManifest. The manifest is written as the first entry to the output stream.- Parameters:
- out- the actual output stream
- man- the optional- Manifest
- Throws:
- IOException- if an I/O error has occurred
 
- 
JarOutputStreamCreates a newJarOutputStreamwith no manifest.- Parameters:
- out- the actual output stream
- Throws:
- IOException- if an I/O error has occurred
 
 
- 
- 
Method Details- 
putNextEntryBegins 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. The current time will be used if the entry has no set modification time.- Overrides:
- putNextEntryin class- ZipOutputStream
- Parameters:
- ze- the ZIP/JAR entry to be written
- Throws:
- ZipException- if a ZIP error has occurred
- IOException- if an I/O error has occurred
 
 
-