|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
java.util.zip.InflaterInputStream
public class InflaterInputStream
此类为解压缩 "deflate" 压缩格式的数据实现流过滤器。它还用作其他解压缩过滤器(如 GZIPInputStream)的基础。
Inflater
| 字段摘要 | |
|---|---|
protected byte[] |
buf 用于解压缩的输入缓冲区。 |
protected Inflater |
inf 流的解压缩器。 |
protected int |
len 输入缓冲区的长度。 |
| 从类 java.io.FilterInputStream 继承的字段 |
|---|
in |
| 构造方法摘要 | |
|---|---|
InflaterInputStream(InputStream in) 使用默认解压缩器和缓冲区大小创建一个新输入流。 |
|
InflaterInputStream(InputStream in, Inflater inf) 创建一个带有指定解压缩器和默认缓冲区大小的新输入流。 |
|
InflaterInputStream(InputStream in, Inflater inf, int size) 使用指定解压缩器和缓冲区大小创建一个新输入流。 |
|
| 方法摘要 | |
|---|---|
int |
available() 在到达 EOF 后返回 0;否则始终返回 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) 跳过指定的未压缩数据的字节数。 |
| 从类 java.io.FilterInputStream 继承的方法 |
|---|
read |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected Inflater inf
protected byte[] buf
protected int len
| 构造方法详细信息 |
|---|
public InflaterInputStream(InputStream in,
Inflater inf,
int size)
in - 输入流
inf - 解压缩器 ("inflater")
size - 输入缓冲区大小
IllegalArgumentException - 如果大小为 <= 0
public InflaterInputStream(InputStream in,
Inflater inf)
in - 输入流
inf - 解压缩器 ("inflater")
public InflaterInputStream(InputStream in)
in - 输入流
| 方法详细信息 |
|---|
public int read()
throws IOException
FilterInputStream 中的
read
IOException - 如果发生 I/O 错误
FilterInputStream.in
public int read(byte[] b,
int off,
int len)
throws IOException
len 不为零,则在可以解压缩某些输入之前,此方法将处于阻塞状态;否则不读取字节并且返回
0。
FilterInputStream 中的
read
b - 读入数据的缓冲区
off - 目标数组
b 中的初始偏移量
len - 读取字节的最大数
NullPointerException - 如果
b 为
null。
IndexOutOfBoundsException - 如果
off 为负,或者
len 为负或
len 大于
b.length - off
ZipException - 如果发生 ZIP 格式错误
IOException - 如果发生 I/O 错误
FilterInputStream.in
public int available()
throws IOException
程序不应依靠此方法返回无阻塞读取的实际字节数。
FilterInputStream 中的
available
IOException - 如果发生 I/O 错误。
public long skip(long n)
throws IOException
FilterInputStream 中的
skip
n - 要跳过的字节数
IOException - 如果发生 I/O 错误
IllegalArgumentException - 如果 n < 0
public void close()
throws IOException
Closeable 中的
close
FilterInputStream 中的
close
IOException - 如果发生 I/O 错误
FilterInputStream.in
protected void fill()
throws IOException
IOException - 如果发生 I/O 错误
public boolean markSupported()
mark 和
reset 方法。
InflaterInputStream 的
markSupported 方法返回
false。
FilterInputStream 中的
markSupported
boolean 值,指示此流类型是否支持
mark 和
reset 方法。
InputStream.mark(int),
InputStream.reset()
public void mark(int readlimit)
InflaterInputStream 的 mark 方法不执行任何操作。
FilterInputStream 中的
mark
readlimit - 在标记位置变为无效前可以读取字节的最大限制。
InputStream.reset()
public void reset()
throws IOException
mark 方法时的位置。
除了抛出 IOException 之外,类 InflaterInputStream 的方法 reset 不执行任何操作。
FilterInputStream 中的
reset
IOException - 如果调用此方法。
InputStream.mark(int),
IOException
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。