ZipInputStream 

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 −

publicclassZipInputStreamextendsInflaterInputStream

Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career.

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
1ZipInputStream(InputStream in)Creates a new ZIP input stream.
2ZipInputStream(InputStream in, Charset charset)Creates a new ZIP input stream.

Class Methods

Sr.No.Method & Description
1int available()Returns 0 after EOF has reached for the current entry data, otherwise always return 1.
2void close()Closes this input stream and releases any system resources associated with the stream.
3void closeEntry()Closes the current ZIP entry and positions the stream for reading the next entry.
4ZipEntry getNextEntry()Reads the next ZIP file entry and positions the stream at the beginning of the entry data.
5int read(byte[] b, int off, int len)Reads from the current ZIP entry into an array of bytes.
6long skip(long n)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

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *