Javazip 简明教程
java.util.zip - ZipInputStream Class
Introduction
java.util.zip.ZipInputStream 类实现了用于读取 ZIP 文件格式中的文件的输入流过滤器。包括对压缩和非压缩文件的支持。
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
java.util.zip.ZipInputStream 类的声明如下所示:
Following is the declaration for java.util.zip.ZipInputStream class −
public class ZipInputStream
extends InflaterInputStream
Fields
java.util.zip.ZipInputStream 类的字段如下所示:
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 |
int available()Returns 0 after EOF has reached for the current entry data, otherwise always return 1. |
2 |
void close()Closes this input stream and releases any system resources associated with the stream. |
3 |
void closeEntry()Closes the current ZIP entry and positions the stream for reading the next entry. |
4 |
ZipEntry getNextEntry()Reads the next ZIP file entry and positions the stream at the beginning of the entry data. |
5 |
int read(byte[] b, int off, int len)Reads from the current ZIP entry into an array of bytes. |
6 |
long skip(long n)Skips specified number of bytes in the current ZIP entry. |