ZipFile (Java SE 25 & JDK 25)
Class ZipFile
- All Implemented Interfaces:
Closeable, AutoCloseable
- Direct Known Subclasses:
JarFile
-
Field Summary
Fields
Modifier and Type
Field
Description
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 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 intMode flag to open a ZIP file and mark it for deletion.
static final intMode flag to open a ZIP file for reading.
-
Constructor Summary
Constructors
Constructor
Description
Opens a ZIP file for reading given the specified File object.
Opens a new
ZipFileto read from the specifiedFileobject in the specified mode.Opens a new
ZipFileto read from the specifiedFileobject in the specified mode.Opens a ZIP file for reading given the specified File object.
Opens a ZIP file for reading.
Opens a ZIP file for reading.
-
Method Summary
Modifier and Type
Method
Description
voidclose()entries()Returns an enumeration of the ZIP file entries.
Returns the ZIP file comment.
Returns the ZIP file entry for the specified name, or null if not found.
Returns an input stream for reading the contents of the specified ZIP file entry.
getName()Returns the path name of the ZIP file.
intsize()Returns the number of entries in the ZIP file.
stream()Returns an ordered
Streamover the ZIP file entries.toString()Returns a string identifying this
ZipFile, for debugging.
-
Field Details
-
OPEN_READ
-
OPEN_DELETE
-
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
-
ZipFile
-
ZipFile
-
ZipFile
-
ZipFile
-
ZipFile
-
ZipFile
-
-
Method Details
-
getComment
-
getEntry
-
getInputStream
-
getName
-
toString
-
entries
-
stream
-
size
-
close
-