JarOutputStream
open class JarOutputStream : 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.
Summary
| Public constructors |
|
Creates a new JarOutputStream with the specified Manifest.
|
|
Creates a new JarOutputStream with no manifest.
|
| Public methods |
| open Unit |
Begins writing a new JAR file entry and positions the stream to the start of the entry data.
|
| Inherited functions |
From class ZipOutputStream
Unit |
close()
Closes the ZIP output stream as well as the stream being filtered.
|
Unit |
closeEntry()
Closes the current ZIP entry and positions the stream for writing the next entry.
|
Unit |
finish()
Finishes writing the contents of the ZIP output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.
|
Unit |
setComment(: String!)
Sets the ZIP file comment.
|
Unit |
setLevel(level: Int)
Sets the compression level for subsequent entries which are DEFLATED. The default setting is DEFAULT_COMPRESSION.
|
Unit |
setMethod(method: Int)
Sets the default compression method for subsequent entries. This default will be used whenever the compression method is not specified for an individual ZIP file entry, and is initially set to DEFLATED.
|
Unit |
write(b: ByteArray!, off: Int, len: Int)
Writes an array of bytes to the current ZIP entry data. This method will block until all the bytes are written.
|
|
From class DeflaterOutputStream
Unit |
deflate()
Writes next block of compressed data to the output stream.
|
Unit |
flush()
Flushes the compressed output stream. If syncFlush is true when this compressed output stream is constructed, this method first flushes the underlying compressor with the flush mode Deflater#SYNC_FLUSH to force all pending data to be flushed out to the output stream and then flushes the output stream. Otherwise this method only flushes the output stream without flushing the compressor.
|
Unit |
write(b: Int)
Writes a byte to the compressed output stream. This method will block until the byte can be written.
|
|
From class FilterOutputStream
Unit |
write(b: ByteArray!)
Writes b.length bytes to this output stream.
The write method of FilterOutputStream calls its write method of three arguments with the arguments b, 0, and b.length.
Note that this method does not call the one-argument write method of its underlying stream with the single argument b.
|
|
Constants
CENATT
static val CENATT: Int
Value: 36
CENATX
static val CENATX: Int
Value: 38
CENCOM
static val CENCOM: Int
Value: 32
CENCRC
static val CENCRC: Int
Value: 16
CENDSK
static val CENDSK: Int
Value: 34
CENEXT
static val CENEXT: Int
Value: 30
CENFLG
static val CENFLG: Int
Value: 8
CENHDR
static val CENHDR: Int
Value: 46
CENHOW
static val CENHOW: Int
Value: 10
CENLEN
static val CENLEN: Int
Value: 24
CENNAM
static val CENNAM: Int
Value: 28
CENOFF
static val CENOFF: Int
Value: 42
CENSIG
static val CENSIG: Long
Value: 33639248L
CENSIZ
static val CENSIZ: Int
Value: 20
CENTIM
static val CENTIM: Int
Value: 12
CENVEM
static val CENVEM: Int
Value: 4
CENVER
static val CENVER: Int
Value: 6
ENDCOM
static val ENDCOM: Int
Value: 20
ENDHDR
static val ENDHDR: Int
Value: 22
ENDOFF
static val ENDOFF: Int
Value: 16
ENDSIG
static val ENDSIG: Long
Value: 101010256L
ENDSIZ
static val ENDSIZ: Int
Value: 12
ENDSUB
static val ENDSUB: Int
Value: 8
ENDTOT
static val ENDTOT: Int
Value: 10
EXTCRC
static val EXTCRC: Int
Value: 4
EXTHDR
static val EXTHDR: Int
Value: 16
EXTLEN
static val EXTLEN: Int
Value: 12
EXTSIG
static val EXTSIG: Long
Value: 134695760L
EXTSIZ
static val EXTSIZ: Int
Value: 8
LOCCRC
static val LOCCRC: Int
Value: 14
LOCEXT
static val LOCEXT: Int
Value: 28
LOCFLG
static val LOCFLG: Int
Value: 6
LOCHDR
static val LOCHDR: Int
Value: 30
LOCHOW
static val LOCHOW: Int
Value: 8
LOCLEN
static val LOCLEN: Int
Value: 22
LOCNAM
static val LOCNAM: Int
Value: 26
LOCSIG
static val LOCSIG: Long
Value: 67324752L
LOCSIZ
static val LOCSIZ: Int
Value: 18
LOCTIM
static val LOCTIM: Int
Value: 10
LOCVER
static val LOCVER: Int
Value: 4
Public constructors
<init>
JarOutputStream(
out: OutputStream!,
man: Manifest!)
Creates a new JarOutputStream with the specified Manifest. The manifest is written as the first entry to the output stream.
| Exceptions |
java.io.IOException |
if an I/O error has occurred |
<init>
JarOutputStream(out: OutputStream!)
Creates a new JarOutputStream with no manifest.
| Exceptions |
java.io.IOException |
if an I/O error has occurred |
Public methods
putNextEntry
open fun putNextEntry(ze: ZipEntry!): Unit
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. The current time will be used if the entry has no set modification time.
| Parameters |
e |
the ZIP entry to be written |
ze |
ZipEntry!: the ZIP/JAR entry to be written |
| Exceptions |
java.util.zip.ZipException |
if a ZIP error has occurred |
java.io.IOException |
if an I/O error has occurred |