public class InflaterInputStream extends FilterInputStream
Inflater
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buf
减压输入缓冲器。
|
protected Inflater |
inf
流的解压器。
|
protected int |
len
输入缓冲区长度。
|
in
Constructor and Description |
---|
InflaterInputStream(InputStream in)
创建一个默认的解压器和缓冲区大小的一个新的输入流。
|
InflaterInputStream(InputStream in, Inflater inf)
创建具有指定的解压器和默认缓冲区大小的一个新的输入流。
|
InflaterInputStream(InputStream in, Inflater inf, int size)
创建具有指定缓冲区大小的装置和一个新的输入流。
|
Modifier and Type | Method and Description |
---|---|
int |
available()
0后返回EOF已经达到,否则总是返回1。
|
void |
close()
关闭此输入流并释放与流关联的任何系统资源。
|
protected void |
fill()
用更多数据填充输入缓冲区减压。
|
void |
mark(int readlimit)
标记此输入流中的当前位置。
|
boolean |
markSupported()
如果输入流的支持
mark 和
reset 方法。
|
int |
read()
读取一个字节的压缩数据。
|
int |
read(byte[] b, int off, int len)
读取压缩数据到字节数组。
|
void |
reset()
重新定位该流在时间的
mark 方法的位置上呼吁这个输入流。
|
long |
skip(long n)
跳过指定的未压缩的数据字节数。
|
read
protected Inflater inf
protected byte[] buf
protected int len
public InflaterInputStream(InputStream in, Inflater inf, int size)
in
-输入流
inf
-解压缩(“打气筒”)
size
-输入缓冲区的大小
size <= 0
IllegalArgumentException
public InflaterInputStream(InputStream in, Inflater inf)
in
-输入流
inf
-解压缩(“打气筒”)
public InflaterInputStream(InputStream in)
in
-输入流
public int read() throws IOException
read
方法重写,继承类
FilterInputStream
IOException
如果发生I/O错误
FilterInputStream.in
public int read(byte[] b, int off, int len) throws IOException
len
不为零,该方法将阻塞直到某些输入可以解压缩;否则,没有字节读取和
0
返回。
read
方法重写,继承类
FilterInputStream
b
-缓冲区中读取数据
off
-目标数组
b
的起始偏移量
len
-的最大字节数读
null
b
NullPointerException
。
IndexOutOfBoundsException
-如果
off
是负的,
len
是负的,或
len
大于
b.length - off
ZipException
如果发生ZIP格式错误
IOException
如果发生I/O错误
FilterInputStream.in
public int available() throws IOException
程序不应该依赖此方法返回可读取的实际字节数,而不需要阻塞。
available
方法重写,继承类
FilterInputStream
IOException
如果I/O错误发生。
public long skip(long n) throws IOException
skip
方法重写,继承类
FilterInputStream
n
-字节数跳过
IOException
如果发生I/O错误
n < 0
IllegalArgumentException
public void close() throws IOException
close
接口
Closeable
close
接口
AutoCloseable
close
方法重写,继承类
FilterInputStream
IOException
如果发生I/O错误
FilterInputStream.in
protected void fill() throws IOException
IOException
如果发生I/O错误
public boolean markSupported()
mark
和
reset
方法。对
InflaterInputStream
返回
false
的
markSupported
方法。
markSupported
方法重写,继承类
FilterInputStream
boolean
表示如果这流类型支持
mark
和
reset
方法。
InputStream.mark(int)
,
InputStream.reset()
public void mark(int readlimit)
对InflaterInputStream
的mark
方法不。
mark
方法重写,继承类
FilterInputStream
readlimit
-字节可以在标记位置无效阅读最大限度。
InputStream.reset()
public void reset() throws IOException
mark
方法的位置上呼吁这个输入流。
类的方法InflaterInputStream
reset
仅仅抛出一个IOException
。
reset
方法重写,继承类
FilterInputStream
IOException
。
InputStream.mark(int)
,
IOException
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.