- 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 - ZipOutputStream Class
Introduction
The java.util.zip.ZipOutputStream class implements an output stream filter for writing files in the ZIP file format. Includes support for both compressed and uncompressed entries.
Class declaration
Following is the declaration for java.util.zip.ZipOutputStream class −
pubpc class ZipOutputStream extends DeflaterOutputStream
Fields
Following are the fields for java.util.zip.ZipOutputStream 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 DEFLATED − Compression method for compressed (DEFLATED) entries.
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 STORED − Compression method for uncompressed (STORED) entries.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | ZipOutputStream(OutputStream out) Creates a new ZIP output stream. |
2 | ZipOutputStream(OutputStream out, Charset charset) Creates a new ZIP output stream. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Closes the ZIP output stream as well as the stream being filtered. |
2 | void closeEntry() Closes the current ZIP entry and positions the stream for writing the next entry. |
3 | Finishes writing the contents of the ZIP output stream without closing the underlying stream. |
4 | Begins writing a new ZIP file entry and positions the stream to the start of the entry data. |
5 | Sets the ZIP file comment. |
6 | Sets the compression level for subsequent entries which are DEFLATED. |
7 | Sets the default compression method for subsequent entries. |
8 | Writes an array of bytes to the current ZIP entry data. |
Methods inherited
This class inherits methods from the following classes −
java.util.zip.DeflaterOutputStream
java.io.FilterOutputStream
java.lang.Object