ZipOutputStream (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
- Direct Known Subclasses:
JarOutputStream
-
Field Summary
Fields
static final intCentral directory (CEN) header internal file attributes field offset.
static final intCentral directory (CEN) header external file attributes field offset.
static final intCentral directory (CEN) header comment length field offset.
static final intCentral directory (CEN) header uncompressed file crc-32 value field offset.
static final intCentral directory (CEN) header disk number start field offset.
static final intCentral directory (CEN) header extra field length field offset.
static final intCentral directory (CEN) header encrypt, decrypt flags field offset.
static final intCentral directory (CEN) header size in bytes (including signature).
static final intCentral directory (CEN) header compression method field offset.
static final intCentral directory (CEN) header uncompressed size field offset.
static final intCentral directory (CEN) header filename length field offset.
static final intCentral directory (CEN) header LOC header offset field offset.
static final longCentral directory (CEN) header signature.
static final intCentral directory (CEN) header compressed size field offset.
static final intCentral directory (CEN) header modification time field offset.
static final intCentral directory (CEN) header version made by field offset.
static final intCentral directory (CEN) header version needed to extract field offset.
static final intCompression method for compressed (DEFLATED) entries.
static final intEnd of central directory (END) header ZIP file comment length field offset.
static final intEnd of central directory (END) header size in bytes (including signature).
static final intEnd of central directory (END) header offset for the first CEN header field offset.
static final longEnd of central directory (END) header signature.
static final intEnd of central directory (END) header central directory size in bytes field offset.
static final intEnd of central directory (END) header number of entries on this disk field offset.
static final intEnd of central directory (END) header total number of entries field offset.
static final intExtra local (EXT) header uncompressed file crc-32 value field offset.
static final intExtra local (EXT) header size in bytes (including signature).
static final intExtra local (EXT) header uncompressed size field offset.
static final longExtra local (EXT) header signature.
static final intExtra local (EXT) header compressed size field offset.
static final intLocal file (LOC) header uncompressed file crc-32 value field offset.
static final intLocal file (LOC) header extra field length field offset.
static final intLocal file (LOC) header general purpose bit flag field offset.
static final intLocal file (LOC) header size in bytes (including signature).
static final intLocal file (LOC) header compression method field offset.
static final intLocal file (LOC) header uncompressed size field offset.
static final intLocal file (LOC) header filename length field offset.
static final longLocal file (LOC) header signature.
static final intLocal file (LOC) header compressed size field offset.
static final intLocal file (LOC) header modification time field offset.
static final intLocal file (LOC) header version needed to extract field offset.
static final intCompression method for uncompressed (STORED) entries.
Fields declared in class DeflaterOutputStream
protected byte[]Output buffer for writing compressed data.
Compressor for this stream.
-
Constructor Summary
Constructors
Creates a new ZIP output stream.
Creates a new ZIP output stream.
-
Method Summary
voidclose()Closes the underlying stream and the stream being filtered after the contents of the ZIP output stream are fully written.
voidCloses the current ZIP entry and positions the stream for writing the next entry.
voidfinish()Finishes writing the contents of the ZIP output stream without closing the underlying stream.
voidBegins writing a new ZIP file entry and positions the stream to the start of the entry data.
voidSets the ZIP file comment.
voidsetLevel(int level) Sets the compression level for subsequent entries which are DEFLATED.
voidsetMethod(int method) Sets the default compression method for subsequent entries.
voidwrite(byte[] b, int off, int len) Writes an array of bytes to the current ZIP entry data.
Methods declared in class DeflaterOutputStream
protected voidWrites next block of compressed data to the output stream.
voidFlushes the compressed output stream.
voidWrites a byte to the compressed output stream.
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitCreates and returns a copy of this object.
booleanIndicates whether some other object is "equal to" this one.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.intReturns a hash code value for this object.
final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
Returns a string representation of the object.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
STORED
-
DEFLATED
-
LOCSIG
-
EXTSIG
-
CENSIG
-
ENDSIG
-
LOCHDR
-
EXTHDR
-
CENHDR
-
ENDHDR
-
LOCVER
-
LOCFLG
-
LOCHOW
-
LOCTIM
-
LOCCRC
-
LOCSIZ
-
LOCLEN
-
LOCNAM
-
LOCEXT
-
EXTCRC
-
EXTSIZ
-
EXTLEN
-
CENVEM
-
CENVER
-
CENFLG
-
CENHOW
-
CENTIM
-
CENCRC
-
CENSIZ
-
CENLEN
-
CENNAM
-
CENEXT
-
CENCOM
-
CENDSK
-
CENATT
-
CENATX
-
CENOFF
-
ENDSUB
-
ENDTOT
-
ENDSIZ
-
ENDOFF
-
ENDCOM
-
-
Constructor Details
-
ZipOutputStream
-
ZipOutputStream
-
-
Method Details
-
setMethod
-
setLevel
-
putNextEntry
-
closeEntry
-
write
-
finish
-
close