- java.util.zip - ZipOutputStream
- java.util.zip - ZipInputStream
- java.util.zip - ZipFile
- java.util.zip - ZipEntry
- java.util.zip - InflaterOutputStream
- java.util.zip - InflaterInputStream
- java.util.zip - Inflater
- java.util.zip - GZIPOutputStream
- java.util.zip - GZIPInputStream
- java.util.zip - DeflaterOutputStream
- java.util.zip - DeflaterInputStream
- java.util.zip - Deflater
- java.util.zip - CRC32
- java.util.zip - CheckedOutputStream
- java.util.zip - CheckedInputStream
- java.util.zip - Adler32
- java.util.zip - Home
java.util.zip Package Extras
- java.util.zip - Discussion
- java.util.zip - Useful Resources
- java.util.zip - Quick Guide
- java.util.zip - Error
- java.util.zip - Exceptions
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
java.util.zip - ZipFile Class
Introduction
The java.util.zip.ZipFile class is used to read entries from a zip file.
Class declaration
Following is the declaration for java.util.zip.ZipFile class −
pubpc class ZipFile extends Object implements Closeable
Fields
Following are the fields for java.util.zip.ZipFile class −
static int CENATT
static int CENATX
static int CENCOM
static int CENCRC
static int CENDSK
static int CENEXT
static int CENFLG
static int CENHDR
static int CENHOW
static int CENLEN
static int CENNAM
static int CENOFF
static long CENSIG
static int CENSIZ
static int CENTIM
static int CENVEM
static int CENVER
static int ENDCOM
static int ENDHDR
static int ENDOFF
static long ENDSIG
static int ENDSIZ
static int ENDSUB
static int ENDTOT
static int EXTCRC
static int EXTHDR
static int EXTLEN
static long EXTSIG
static int EXTSIZ
static int LOCCRC
static int LOCEXT
static int LOCFLG
static int LOCHDR
static int LOCHOW
static int LOCLEN
static int LOCNAM
static long LOCSIG
static int LOCSIZ
static int LOCTIM
static int LOCVER
static int OPEN_DELETE − Mode flag to open a zip file and mark it for deletion.
static int OPEN_READ − Mode flag to open a zip file for reading.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | ZipFile(File file) Opens a ZIP file for reading given the specified File object. |
2 | ZipFile(File file, Charset charset) Opens a ZIP file for reading given the specified File object. |
3 | ZipFile(File file, int mode) Opens a new ZipFile to read from the specified File object in the specified mode. |
4 | ZipFile(File file, int mode, Charset charset) Opens a new ZipFile to read from the specified File object in the specified mode. |
5 | ZipFile(String name) Opens a zip file for reading. |
6 | ZipFile(String name, Charset charset) Opens a zip file for reading. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Closes the ZIP file. |
2 | Returns an enumeration of the ZIP file entries. |
3 | Returns the zip file comment, or null if none. |
4 | Returns the zip file entry for the specified name, or null if not found. |
5 | Returns an input stream for reading the contents of the specified zip file entry. |
6 | Returns the path name of the ZIP file. |
7 | Returns the number of entries in the ZIP file. |
Methods inherited
This class inherits methods from the following classes −
Java.lang.Object