public class InflaterOutputStream extends FilterOutputStream
InflaterInputStream , DeflaterInputStream , DeflaterOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buf
用于写入未压缩数据的输出缓冲区。
|
protected Inflater |
inf
解压缩此流。
|
out| Constructor and Description |
|---|
InflaterOutputStream(OutputStream out)
使用默认解压缩器和缓冲区大小创建新的输出流。
|
InflaterOutputStream(OutputStream out, Inflater infl)
使用指定的解压缩器和默认缓冲区大小创建新的输出流。
|
InflaterOutputStream(OutputStream out, Inflater infl, int bufLen)
使用指定的解压缩器和缓冲区大小创建新的输出流。
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
将任何剩余的未压缩数据写入输出流并关闭底层输出流。
|
void |
finish()
完成将未压缩数据写入输出流,而不关闭底层流。
|
void |
flush()
刷新此输出流,强制任何待处理的缓冲输出字节被写入。
|
void |
write(byte[] b, int off, int len)
将一组字节写入未压缩的输出流。
|
void |
write(int b)
将一个字节写入未压缩的输出流。
|
writeprotected final Inflater inf
protected final byte[] buf
public InflaterOutputStream(OutputStream out)
out - 将未压缩数据写入的输出流
NullPointerException - 如果
out为空
public InflaterOutputStream(OutputStream out, Inflater infl)
out - 将未压缩数据写入的输出流
infl - 此流的解压缩程序(“inflater”)
NullPointerException - 如果
out或
infl为空
public InflaterOutputStream(OutputStream out, Inflater infl, int bufLen)
out - 将未压缩数据写入的输出流
infl - 此流的解压缩程序(“inflater”)
bufLen - 解压缩缓冲区大小
IllegalArgumentException - 如果
bufLen <= 0
NullPointerException - 如果
out或
infl为空
public void close()
throws IOException
close在界面
Closeable
close在界面
AutoCloseable
close在类别
FilterOutputStream
IOException - 如果发生I / O错误
FilterOutputStream.flush() ,
FilterOutputStream.out
public void flush()
throws IOException
flush在界面
Flushable
flush在类别
FilterOutputStream
IOException - 如果发生I / O错误或该流已经关闭
FilterOutputStream.out
public void finish()
throws IOException
IOException - 如果发生I / O错误或该流已经关闭
public void write(int b)
throws IOException
write在
FilterOutputStream
b - 解压缩和写入输出流的压缩数据的单字节
IOException - 如果发生I / O错误或该流已经关闭
ZipException - 如果发生压缩(ZIP)格式错误
public void write(byte[] b,
int off,
int len)
throws IOException
write在类别
FilterOutputStream
b - 包含压缩数据以缓冲和写入输出流的缓冲区
off - b内
b数据的起始偏移量
len - 从
b的字节数
IndexOutOfBoundsException - 如果
off < 0 ,或如果
len < 0 ,或如果
len > b.length - off
IOException - 如果发生I / O错误或该流已经关闭
NullPointerException - 如果
b为空
ZipException - 如果发生压缩(ZIP)格式错误
FilterOutputStream.write(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.