public class ZipInputStream extends InflaterInputStream
Modifier and Type | Field and Description |
---|---|
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 |
buf, inf, len
in
Constructor and Description |
---|
ZipInputStream(InputStream in)
创建一个新的压缩输入流。
|
ZipInputStream(InputStream in, Charset charset)
创建一个新的压缩输入流。
|
Modifier and Type | Method and Description |
---|---|
int |
available()
0后返回EOF达到当前输入数据,否则总是返回1。
|
void |
close()
关闭此输入流并释放与流关联的任何系统资源。
|
void |
closeEntry()
关闭当前的压缩条目并将流用于读取下一个条目。
|
protected ZipEntry |
createZipEntry(String name)
创建指定条目名称的新
ZipEntry 对象。
|
ZipEntry |
getNextEntry()
读取下一个压缩文件条目,并在输入数据的开头处的流中的位置。
|
int |
read(byte[] b, int off, int len)
从当前的压缩条目读入一个字节数组。
|
long |
skip(long n)
跳过当前ZIP项的指定字节数。
|
fill, mark, markSupported, read, reset
read
public static final long LOCSIG
public static final long EXTSIG
public static final long CENSIG
public static final long ENDSIG
public static final int LOCHDR
public static final int EXTHDR
public static final int CENHDR
public static final int ENDHDR
public static final int LOCVER
public static final int LOCFLG
public static final int LOCHOW
public static final int LOCTIM
public static final int LOCCRC
public static final int LOCSIZ
public static final int LOCLEN
public static final int LOCNAM
public static final int LOCEXT
public static final int EXTCRC
public static final int EXTSIZ
public static final int EXTLEN
public static final int CENVEM
public static final int CENVER
public static final int CENFLG
public static final int CENHOW
public static final int CENTIM
public static final int CENCRC
public static final int CENSIZ
public static final int CENLEN
public static final int CENNAM
public static final int CENEXT
public static final int CENCOM
public static final int CENDSK
public static final int CENATT
public static final int CENATX
public static final int CENOFF
public static final int ENDSUB
public static final int ENDTOT
public static final int ENDSIZ
public static final int ENDOFF
public static final int ENDCOM
public ZipInputStream(InputStream in)
UTF-8 charset
用于解码的入口名。
in
-实际输入流
public ZipInputStream(InputStream in, Charset charset)
in
-实际输入流
charset
-
charset用来解码压缩条目名称(如果拉链入口的通用位标志的
language encoding bit设置忽略)。
public ZipEntry getNextEntry() throws IOException
ZipException
如果发生ZIP文件错误
IOException
如果发生I/O错误
public void closeEntry() throws IOException
ZipException
如果发生ZIP文件错误
IOException
如果发生I/O错误
public int available() throws IOException
程序不应该依赖此方法返回可读取的实际字节数,而不需要阻塞。
available
方法重写,继承类
InflaterInputStream
IOException
如果I/O错误发生。
public int read(byte[] b, int off, int len) throws IOException
len
不为零,该方法阻塞直到输入可用;否则,没有字节读取和
0
返回。
read
方法重写,继承类
InflaterInputStream
b
-缓冲区中读取数据
off
-开始抵消目标数组
b
len
-的最大字节数读
null
b
NullPointerException
。
IndexOutOfBoundsException
-如果
off
是负的,
len
是负的,或
len
大于
b.length - off
ZipException
如果发生ZIP文件错误
IOException
如果发生I/O错误
FilterInputStream.in
public long skip(long n) throws IOException
skip
方法重写,继承类
InflaterInputStream
n
-字节数跳过
ZipException
如果发生ZIP文件错误
IOException
如果发生I/O错误
n < 0
IllegalArgumentException
public void close() throws IOException
close
接口
Closeable
close
接口
AutoCloseable
close
方法重写,继承类
InflaterInputStream
IOException
如果发生I/O错误
FilterInputStream.in
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.