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()
到达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)
跳过未压缩数据的指定字节数。
|
readprotected Inflater inf
protected byte[] buf
protected int len
public InflaterInputStream(InputStream in, Inflater inf, int size)
in - 输入流
inf - 解压缩器(“inflater”)
size - 输入缓冲区大小
IllegalArgumentException - 如果是
size <= 0
public InflaterInputStream(InputStream in, Inflater inf)
in - 输入流
inf - 解压缩器(“inflater”)
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 - 读取的最大字节数
NullPointerException - 如果
b是
null 。
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错误
IllegalArgumentException - 如果
n < 0
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方法。
markSupported方法InflaterInputStream返回false 。
markSupported在类别
FilterInputStream
boolean表示这个流类型是否支持
mark和
reset方法。
InputStream.mark(int) ,
InputStream.reset()
public void mark(int readlimit)
该mark的方法InflaterInputStream什么都不做。
mark在类别
FilterInputStream
readlimit - 在标记位置无效之前可以读取的字节数上限。
InputStream.reset()
public void reset()
throws IOException
mark方法时的位置。
该方法reset类InflaterInputStream什么也不做只是抛出一个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.