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()
到达EOF后返回0,否则总是返回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 - 压缩缓冲区大小
IllegalArgumentException - 如果
bufLen <= 0
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
IndexOutOfBoundsException - 如果
len > b.length - off
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.