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)
写一个字节到未压缩的输出流。
|
write
protected final Inflater inf
protected final byte[] buf
public InflaterOutputStream(OutputStream out)
out
输出流写的未压缩的数据
NullPointerException
-如果
out
是空的
public InflaterOutputStream(OutputStream out, Inflater infl)
out
输出流写的未压缩的数据
infl
解压缩(“打气筒”)该流
NullPointerException
-如果
out
或
infl
是空的
public InflaterOutputStream(OutputStream out, Inflater infl, int bufLen)
out
输出流写的未压缩的数据
infl
解压缩(“打气筒”)该流
bufLen
-减压缓冲区大小
bufLen <= 0
IllegalArgumentException
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
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.