java.util.zip – ZipOutputStream

java.util.zip – ZipOutputStream Class ”; Previous Next 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 − public 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 void close() 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 void finish() Finishes writing the contents of the ZIP output stream without closing the underlying stream. 4 void putNextEntry(ZipEntry e) Begins writing a new ZIP file entry and positions the stream to the start of the entry data. 5 void setComment(String comment) Sets the ZIP file comment. 6 void setLevel(int level) Sets the compression level for subsequent entries which are DEFLATED. 7 void setMethod(int method) Sets the default compression method for subsequent entries. 8 void write(byte[] b, int off, int len) 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 Print Page Previous Next Advertisements ”;

java.util.zip – Adler32

java.util.zip – Adler32 Class ”; Previous Next 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 reliable as a CRC-32 but can be computed much faster. Class Declaration Following is the declaration for java.util.zip.Adler32 class − public 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 long getValue() Returns the checksum value. 2 void reset() Resets the checksum to initial value. 3 void update(byte[] b) Updates the checksum with the specified array of bytes. 4 void update(byte[] b, int off, int len) Updates the checksum with the specified array of bytes. 5 void update(int b) 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 Print Page Previous Next Advertisements ”;