|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
java.util.zip.InflaterInputStream
java.util.zip.GZIPInputStream
public class GZIPInputStream
此类为读取 GZIP 文件格式的压缩数据实现流过滤器。
InflaterInputStream| 字段摘要 | |
|---|---|
protected CRC32 |
crc
未压缩数据的 CRC-32。 |
protected boolean |
eos
指示输入流的结尾。 |
static int |
GZIP_MAGIC
GZIP 头幻数。 |
| 从类 java.util.zip.InflaterInputStream 继承的字段 |
|---|
buf, inf, len |
| 从类 java.io.FilterInputStream 继承的字段 |
|---|
in |
| 构造方法摘要 | |
|---|---|
GZIPInputStream(InputStream in)
使用默认缓冲区大小创建新的输入流。 |
|
GZIPInputStream(InputStream in,
int size)
使用指定缓冲区大小创建新的输入流。 |
|
| 方法摘要 | |
|---|---|
void |
close()
关闭此输入流并释放与该流关联的所有系统资源。 |
int |
read(byte[] buf,
int off,
int len)
将未压缩数据读入字节数组。 |
| 从类 java.util.zip.InflaterInputStream 继承的方法 |
|---|
available, fill, mark, markSupported, read, reset, skip |
| 从类 java.io.FilterInputStream 继承的方法 |
|---|
read |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected CRC32 crc
protected boolean eos
public static final int GZIP_MAGIC
| 构造方法详细信息 |
|---|
public GZIPInputStream(InputStream in,
int size)
throws IOException
in - 输入流size - 输入缓冲区大小
IOException - 如果发生 I/O 错误
IllegalArgumentException - 如果大小为 <= 0
public GZIPInputStream(InputStream in)
throws IOException
in - 输入流
IOException - 如果发生 I/O 错误| 方法详细信息 |
|---|
public int read(byte[] buf,
int off,
int len)
throws IOException
len 不为零,则在可以解压缩某些输入之前,此方法将处于阻塞状态;否则,不读取字节并且返回 0。
InflaterInputStream 中的 readbuf - 要读入数据的缓冲区off - 目标数组 b 中的初始偏移量len - 读取字节的最大数
NullPointerException - 如果 buf 为 null。
IndexOutOfBoundsException - 如果 off 为负,或者 len 为负或 len 大于 buf.length - off
IOException - 如果发生 I/O 错误或压缩输入数据损坏FilterInputStream.in
public void close()
throws IOException
Closeable 中的 closeInflaterInputStream 中的 closeIOException - 如果发生 I/O 错误FilterInputStream.in
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。