- 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 Zip - Quick Guide
java.util.zip - Adler32
Introduction
The java.util.zip.Adler32 class is a class that can be used to compute the Adler-32 checksum of a data stream. An Adler-32 checksum is almost as repable as a CRC-32 but can be computed much faster.
Class declaration
Following is the declaration for java.util.zip.Adler32 class −
pubpc class Adler32 extends Object implements Checksum
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | Adler32() Creates a new Adler32 object. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns the checksum value. |
2 | Resets the checksum to initial value. |
3 | Updates the checksum with the specified array of bytes. |
4 | Updates the checksum with the specified array of bytes. |
5 | Updates the checksum with the specified byte (the low eight bits of the argument b). |
Methods inherited
This class inherits methods from the following classes −
java.lang.Object
java.util.zip - CheckedInputStream Class
Introduction
The java.util.zip.CheckedInputStream class is an input stream that also maintains a checksum of the data being read. The checksum can then be used to verify the integrity of the input data.
Class declaration
Following is the declaration for java.util.zip.CheckedInputStream class −
pubpc class CheckedInputStream extends FilterInputStream
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | CheckedInputStream(InputStream in, Checksum cksum) Creates an input stream using the specified Checksum. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns the Checksum for this input stream. |
2 | Reads a byte. |
3 | Reads into an array of bytes. |
4 | Skips specified number of bytes of input. |
Methods inherited
This class inherits methods from the following classes −
java.io.FilterInputStream
java.lang.Object
java.util.zip - CheckedOutputStream Class
Introduction
The java.util.zip.CheckedOutputStream class is an output stream that also maintains a checksum of the data being written. The checksum can then be used to verify the integrity of the output data.
Class declaration
Following is the declaration for java.util.zip.CheckedOutputStream class −
pubpc class CheckedOutputStream extends FilterOutputStream
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | CheckedOutputStream(OutputStream out, Checksum cksum) Creates an output stream with the specified Checksum. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns the Checksum for this output stream. |
2 | Writes an array of bytes. |
3 | Writes a byte. |
Methods inherited
This class inherits methods from the following classes −
java.io.FilterOutputStream
java.lang.Object
java.util.zip - CRC32 Class
Introduction
The java.util.zip.CRC32 class is a class that can be used to compute the CRC-32 of a data stream.
Class declaration
Following is the declaration for java.util.zip.CRC32 class −
pubpc class CRC32 extends Object implements Checksum
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | CRC32() Creates a new CRC32 object. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns the CRC-32 value. |
2 | Resets the CRC-32 to initial value. |
3 | Updates the CRC-32 checksum with the specified array of bytes. |
4 | Updates the CRC-32 checksum with the specified array of bytes. |
5 | Updates the CRC-32 checksum with the specified byte (the low eight bits of the argument b). |
Methods inherited
This class inherits methods from the following classes −
java.lang.Object
java.util.zip - Deflater Class
Introduction
The java.util.zip.Deflater class provides support for general purpose compression using the popular ZLIB compression pbrary. The ZLIB compression pbrary was initially developed as part of the PNG graphics standard and is not protected by patents. It is fully described in the specifications at the java.util.zip package description.
Class declaration
Following is the declaration for java.util.zip.Deflater class −
pubpc class Deflater extends Object
Fields
Following are the fields for java.util.zip.Deflater class −
static int BEST_COMPRESSION − Compression level for best compression.
static int BEST_SPEED − Compression level for fastest compression.
static int DEFAULT_COMPRESSION − Default compression level.
static int DEFAULT_STRATEGY − Default compression strategy.
static int DEFLATED − Compression method for the deflate algorithm (the only one currently supported).
static int FILTERED − Compression strategy best used for data consisting mostly of small values with a somewhat random distribution.
static int FULL_FLUSH − Compression flush mode used to flush out all pending output and reset the deflater.
static int HUFFMAN_ONLY − Compression strategy for Huffman coding only.
static int NO_COMPRESSION − Compression level for no compression.
static int NO_FLUSH − Compression flush mode used to achieve best compression result.
static int SYNC_FLUSH − Compression flush mode used to flush out all pending output; may degrade compression for some compression algorithms.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | Deflater() Creates a new compressor with the default compression level. |
2 | Deflater(int level) Creates a new compressor using the specified compression level. |
3 | Deflater(int level, boolean nowrap) Creates a new compressor using the specified compression level. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Compresses the input data and fills specified buffer with compressed data. |
2 | Compresses the input data and fills specified buffer with compressed data. |
3 | Compresses the input data and fills the specified buffer with compressed data. |
4 | Closes the compressor and discards any unprocessed input. |
5 | When called, indicates that compression should end with the current contents of the input buffer. |
6 | Returns true if the end of the compressed data output stream has been reached. |
7 | Returns the ADLER-32 value of the uncompressed data. |
8 | Returns the total number of uncompressed bytes input so far. |
9 | Returns the total number of compressed bytes output so far. |
10 | Returns the total number of uncompressed bytes input so far. |
11 | Returns the total number of compressed bytes output so far. |
12 | Returns true if the input data buffer is empty and setInput() should be called in order to provide more input. |
13 | Resets deflater so that a new set of input data can be processed. |
14 | Sets preset dictionary for compression. |
15 | Sets preset dictionary for compression. |
16 | Sets input data for compression. |
17 | Sets input data for compression. |
18 | Sets the current compression level to the specified value. |
19 | Sets the compression strategy to the specified value. |
Methods inherited
This class inherits methods from the following classes −
java.lang.Object
java.util.zip - DeflaterInputStream Class
Introduction
The java.util.zip.DeflaterInputStream class implements an input stream filter for compressing data in the "deflate" compression format.
Class declaration
Following is the declaration for java.util.zip.DeflaterInputStream class −
pubpc class DeflaterInputStream extends FilterInputStream
Fields
Following are the fields for java.util.zip.DeflaterInputStream class −
protected byte[] buf − Input buffer for reading compressed data.
protected Deflater def − Compressor for this stream.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | DeflaterInputStream(InputStream in) Creates a new input stream with a default compressor and buffer size. |
2 | DeflaterInputStream(InputStream in, Deflater defl) Creates a new input stream with the specified compressor and a default buffer size. |
3 | DeflaterInputStream(InputStream in, Deflater defl, int bufLen) Creates a new input stream with the specified compressor and buffer size. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns 0 after EOF has been reached, otherwise always return 1. |
2 | Closes this input stream and its underlying input stream, discarding any pending uncompressed data. |
3 | Reads a single byte of compressed data from the input stream. |
4 | Reads compressed data into a byte array. |
5 | Skips over and discards data from the input stream. |
Methods inherited
This class inherits methods from the following classes −
java.io.FilterInputStream
java.lang.Object
java.util.zip - DeflaterOutputStream Class
Introduction
The java.util.zip.DeflaterOutputStream class implements an output stream filter for compressing data in the "deflate" compression format. It is also used as the basis for other types of compression filters, such as GZIPOutputStream.
Class declaration
Following is the declaration for java.util.zip.DeflaterOutputStream class −
pubpc class DeflaterOutputStream extends FilterOutputStream
Fields
Following are the fields for java.util.zip.DeflaterOutputStream class −
protected byte[] buf − Output buffer for writing compressed data.
protected Deflater def − Compressor for this stream.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | DeflaterOutputStream(OutputStream out) Creates a new output stream with a default compressor and buffer size. |
2 | DeflaterOutputStream(OutputStream out, boolean syncFlush) Creates a new output stream with a default compressor, a default buffer size and the specified flush mode. |
3 | DeflaterOutputStream(OutputStream out, Deflater def) Creates a new output stream with the specified compressor and a default buffer size. |
4 | DeflaterOutputStream(OutputStream out, Deflater def, boolean syncFlush) Creates a new output stream with the specified compressor, flush mode and a default buffer size. |
5 | DeflaterOutputStream(OutputStream out, Deflater def, int size) Creates a new output stream with the specified compressor and buffer size. |
6 | DeflaterOutputStream(OutputStream out, Deflater def, int size, boolean syncFlush) Creates a new output stream with the specified compressor, buffer size and flush mode. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Writes remaining compressed data to the output stream and closes the underlying stream. |
2 | Finishes writing compressed data to the output stream without closing the underlying stream. |
3 | Flushes the compressed output stream. |
4 | Writes an array of bytes to the compressed output stream. |
5 | Writes a byte to the compressed output stream. |
Methods inherited
This class inherits methods from the following classes −
java.io.FilterOutputStream
java.lang.Object
java.util.zip - GZIPInputStream Class
Introduction
The java.util.zip.GZIPInputStream class implements a stream filter for reading compressed data in the GZIP file format.
Class declaration
Following is the declaration for java.util.zip.GZIPInputStream class −
pubpc class GZIPInputStream extends InflaterInputStream
Fields
Following are the fields for java.util.zip.GZIPInputStream class −
protected CRC32 crc − CRC-32 for uncompressed data.
protected boolean eos − Indicates end of input stream.
static int GZIP_MAGIC − GZIP header magic number.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | GZIPInputStream(InputStream in) Creates a new input stream with a default buffer size. |
2 | GZIPInputStream(InputStream in, int size) Creates a new input stream with the specified buffer size. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Closes this input stream and releases any system resources associated with the stream. |
2 | Reads uncompressed data into an array of bytes. |
Methods inherited
This class inherits methods from the following classes −
java.util.zip.InflaterInputStream
java.io.FilterInputStream
java.lang.Object
java.util.zip - GZIPOutputStream Class
Introduction
The java.util.zip.GZIPOutputStream class implements a stream filter for writing compressed data in the GZIP file format.
Class declaration
Following is the declaration for java.util.zip.GZIPOutputStream class −
pubpc class GZIPOutputStream extends DeflaterOutputStream
Fields
Following are the fields for java.util.zip.GZIPOutputStream class −
protected CRC32 crc − CRC-32 for uncompressed data.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | GZIPOutputStream(OutputStream out) Creates a new output stream with a default buffer size. |
2 | GZIPOutputStream(OutputStream out, boolean syncFlush) Creates a new output stream with a default buffer size and the specified flush mode. |
3 | GZIPOutputStream(OutputStream out, int size) Creates a new output stream with the specified buffer size. |
4 | GZIPOutputStream(OutputStream out, int size, boolean syncFlush) Creates a new output stream with the specified buffer size and flush mode. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Finishes writing compressed data to the output stream without closing the underlying stream. |
2 | Writes array of bytes to the compressed output stream. |
Methods inherited
This class inherits methods from the following classes −
java.util.zip.DeflaterOutputStream
java.io.FilterOutputStream
java.lang.Object
java.util.zip - Inflater Class
Introduction
The java.util.zip.Inflater class provides support for general purpose decompression using the popular ZLIB compression pbrary. The ZLIB compression pbrary was initially developed as part of the PNG graphics standard and is not protected by patents. It is fully described in the specifications at the java.util.zip package description.
Class declaration
Following is the declaration for java.util.zip.Inflater class −
pubpc class Inflater extends Object
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | Inflater() Creates a new decompressor. |
2 | Inflater(boolean nowrap) Creates a new decompressor. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Closes the decompressor and discards any unprocessed input. |
2 | Returns true if the end of the compressed data stream has been reached. |
3 | Returns the ADLER-32 value of the uncompressed data. |
4 | Returns the total number of compressed bytes input so far. |
5 | Returns the total number of uncompressed bytes output so far. |
6 | Returns the total number of bytes remaining in the input buffer. |
7 | Returns the total number of compressed bytes input so far. |
8 | Returns the total number of uncompressed bytes output so far. |
9 | Uncompresses bytes into specified buffer. |
10 | Uncompresses bytes into specified buffer. |
11 | Returns true if a preset dictionary is needed for decompression. |
12 | Returns true if no data remains in the input buffer. |
13 | Resets inflater so that a new set of input data can be processed. |
14 | Sets the preset dictionary to the given array of bytes. |
15 | Sets the preset dictionary to the given array of bytes. |
16 | Sets input data for decompression. |
17 | Sets input data for decompression. |
Methods inherited
This class inherits methods from the following classes −
java.lang.Object
java.util.zip - InflaterInputStream Class
Introduction
The java.util.zip.InflaterInputStream class implements a stream filter for uncompressing data in the "deflate" compression format. It is also used as the basis for other decompression filters, such as GZIPInputStream.
Class declaration
Following is the declaration for java.util.zip.InflaterInputStream class −
pubpc class InflaterInputStream extends FilterInputStream
Fields
Following are the fields for java.util.zip.InflaterInputStream class −
protected byte[] buf − Input buffer for decompression.
protected Inflater inf − Decompressor for this stream.
protected int len − Length of input buffer.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | InflaterInputStream(InputStream in) Creates a new input stream with a default decompressor and buffer size. |
2 | InflaterInputStream(InputStream in, Inflater inf) Creates a new input stream with the specified decompressor and a default buffer size. |
3 | InflaterInputStream(InputStream in, Inflater inf, int size) Creates a new input stream with the specified decompressor and buffer size. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns 0 after EOF has been reached, otherwise always return 1. |
2 | Closes this input stream and releases any system resources associated with the stream. |
3 | Marks the current position in this input stream. |
4 | Tests if this input stream supports the mark and reset methods. |
5 | Reads a byte of uncompressed data. |
6 | Reads uncompressed data into an array of bytes. |
7 | Repositions this stream to the position at the time the mark method was last called on this input stream. |
8 | Skips specified number of bytes of uncompressed data. |
Methods inherited
This class inherits methods from the following classes −
java.io.FilterInputStream
java.lang.Object
java.util.zip - InflaterOutputStream Class
Introduction
The java.util.zip.InflaterOutputStream class implements an output stream filter for uncompressing data stored in the "deflate" compression format.
Class declaration
Following is the declaration for java.util.zip.InflaterOutputStream class −
pubpc class InflaterOutputStream extends FilterOutputStream
Fields
Following are the fields for java.util.zip.InflaterOutputStream class −
protected byte[] buf − Output buffer for writing uncompressed data.
protected Inflater inf − Decompressor for this stream.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | InflaterOutputStream(OutputStream out) Creates a new output stream with a default decompressor and buffer size. |
2 | InflaterOutputStream(OutputStream out, Inflater infl) Creates a new output stream with the specified decompressor and a default buffer size. |
3 | InflaterOutputStream(OutputStream out, Inflater infl, int bufLen) Creates a new output stream with the specified decompressor and buffer size. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Writes remaining compressed data to the output stream and closes the underlying stream. |
2 | Finishes writing uncompressed data to the output stream without closing the underlying stream. |
3 | Flushes this output stream, forcing any pending buffered output bytes to be written. |
4 | Writes an array of bytes to the compressed output stream. |
5 | Writes a byte to the compressed output stream. |
Methods inherited
This class inherits methods from the following classes −
java.io.FilterOutputStream
java.lang.Object
java.util.zip - ZipEntry Class
Introduction
The java.util.zip.ZipEntry class is used to represent a ZIP file entry.
Class declaration
Following is the declaration for java.util.zip.ZipEntry class −
pubpc class ZipEntry extends Object implements Cloneable
Fields
Following are the fields for java.util.zip.ZipEntry class −
protected byte[] buf − Output buffer for writing uncompressed data.
protected Inflater inf − Decompressor for this stream.
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 entries.
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | ZipEntry(String name) Creates a new zip entry with the specified name. |
2 | ZipEntry(ZipEntry e) Creates a new zip entry with fields taken from the specified zip entry. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns a copy of this entry. |
2 | Returns the comment string for the entry, or null if none. |
3 | Returns the size of the compressed entry data, or -1 if not known. |
4 | Returns the CRC-32 checksum of the uncompressed entry data, or -1 if not known. |
5 | Returns the extra field data for the entry, or null if none. |
6 | Returns the compression method of the entry, or -1 if not specified. |
7 | Returns the name of the entry. |
8 | Returns the uncompressed size of the entry data, or -1 if not known. |
9 | Returns the modification time of the entry, or -1 if not specified. |
10 | Returns the hash code value for this entry. |
11 | Returns true if this is a directory entry. |
12 | Sets the optional comment string for the entry. |
13 | Sets the CRC-32 checksum of the uncompressed entry data. |
14 | Sets the optional extra field data for the entry. |
15 | Sets the compression method for the entry. |
16 | Sets the uncompressed size of the entry data. |
17 | Sets the modification time of the entry. |
18 | Returns a string representation of the ZIP entry. |
Methods inherited
This class inherits methods from the following classes −
java.io.FilterOutputStream
java.lang.Object
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
java.util.zip - ZipInputStream Class
Introduction
The java.util.zip.ZipInputStream class implements an input stream filter for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries.
Class declaration
Following is the declaration for java.util.zip.ZipInputStream class −
pubpc class ZipInputStream extends InflaterInputStream
Fields
Following are the fields for java.util.zip.ZipInputStream 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
Constructors
Sr.No. | Constructor & Description |
---|---|
1 | ZipInputStream(InputStream in) Creates a new ZIP input stream. |
2 | ZipInputStream(InputStream in, Charset charset) Creates a new ZIP input stream. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | Returns 0 after EOF has reached for the current entry data, otherwise always return 1. |
2 | Closes this input stream and releases any system resources associated with the stream. |
3 | Closes the current ZIP entry and positions the stream for reading the next entry. |
4 | Reads the next ZIP file entry and positions the stream at the beginning of the entry data. |
5 | Reads from the current ZIP entry into an array of bytes. |
6 | Skips specified number of bytes in the current ZIP entry. |
Methods inherited
This class inherits methods from the following classes −
java.util.zip.InflaterInputStream
java.io.FilterInputStream
java.lang.Object
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
Java Zip - Exceptions
Introduction
The java.util.zip Exceptions contains the exceptions which can occur during zip/unzip operations.
Interface Summary
Sr.No. | Exception & Description |
---|---|
1 | DataFormatException Signals that a data format error has occurred. |
2 | ZipException Signals that a Zip exception of some sort has occurred. |
Java Zip - Errors
Introduction
The java.util.zip Error contains the error which can occur during zip/unzip operations.
Interface Summary
Sr.No. | Error & Description |
---|---|
1 | ZipError Signals that an unrecoverable error has occurred. |