public class DeflaterInputStream extends FilterInputStream
DeflaterOutputStream,
InflaterOutputStream,
InflaterInputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buf
读取压缩数据的输入缓冲区。
|
protected Deflater |
def
此流的压缩机。
|
in| Constructor and Description |
|---|
DeflaterInputStream(InputStream in)
创建一个新的输入流,一个默认的压缩机和缓冲区大小。
|
DeflaterInputStream(InputStream in, Deflater defl)
用指定的压缩机和默认缓冲区大小创建一个新的输入流。
|
DeflaterInputStream(InputStream in, Deflater defl, int bufLen)
用指定的压缩和缓冲区大小创建一个新的输入流。
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
0后返回EOF已经达到,否则总是返回1。
|
void |
close()
关闭输入流和其相关的输入流,丢弃任何挂起的未压缩的数据。
|
void |
mark(int limit)
不支持此操作。
|
boolean |
markSupported()
|
int |
read()
从输入流读取一个压缩数据的单个字节。
|
int |
read(byte[] b, int off, int len)
读取压缩数据到一个字节数组。
|
void |
reset()
不支持此操作。
|
long |
skip(long n)
跳过并丢弃数据从输入流。
|
readprotected final Deflater def
protected final byte[] buf
public DeflaterInputStream(InputStream in)
in输入流读取压缩数据
NullPointerException -如果
in是空的
public DeflaterInputStream(InputStream in, Deflater defl)
in输入流读取压缩数据
defl压缩机(“deflater”)该流
NullPointerException -如果
in或
defl是空的
public DeflaterInputStream(InputStream in, Deflater defl, int bufLen)
in输入流读取压缩数据
defl压缩机(“deflater”)该流
bufLen压缩缓冲区大小
bufLen <= 0
IllegalArgumentException
NullPointerException -如果
in或
defl是空的
public void close()
throws IOException
close 接口
Closeable
close 接口
AutoCloseable
close 方法重写,继承类
FilterInputStream
IOException如果I/O错误发生
FilterInputStream.in
public int read()
throws IOException
read 方法重写,继承类
FilterInputStream
IOException -如果发生I/O错误或者该流已关闭
FilterInputStream.in
public int read(byte[] b,
int off,
int len)
throws IOException
read 方法重写,继承类
FilterInputStream
b -数据读入的缓冲
off -在
b数据的起始偏移量
len -压缩的最大字节数读到
b
len > b.length - off
IndexOutOfBoundsException
IOException -如果发生I/O错误或者输入流已关闭
FilterInputStream.in
public long skip(long n)
throws IOException
n是给出一个
long,字节可以跳过的最大数量是
Integer.MAX_VALUE。
skip 方法重写,继承类
FilterInputStream
n -字节数被跳过
IOException -如果发生I/O错误或者该流已关闭
public int available()
throws IOException
程序不应该依赖此方法返回可读取的实际字节数,而不需要阻塞
available 方法重写,继承类
FilterInputStream
IOException -如果发生I/O错误或者该流已关闭
public boolean markSupported()
markSupported 方法重写,继承类
FilterInputStream
FilterInputStream.in,
InputStream.mark(int),
InputStream.reset()
public void mark(int limit)
mark 方法重写,继承类
FilterInputStream
limit最大字节可以在除权的位置标记阅读
FilterInputStream.in,
FilterInputStream.reset()
public void reset()
throws IOException
reset 方法重写,继承类
FilterInputStream
IOException总是抛出
FilterInputStream.in,
FilterInputStream.mark(int)
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.