public class GZIPOutputStream extends DeflaterOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected CRC32 |
crc
未压缩的数据CRC-32。
|
buf, defout| Constructor and Description |
|---|
GZIPOutputStream(OutputStream out)
用默认缓冲区大小创建一个新的输出流。
|
GZIPOutputStream(OutputStream out, boolean syncFlush)
用默认缓冲区大小和指定的刷新模式创建一个新的输出流。
|
GZIPOutputStream(OutputStream out, int size)
用指定的缓冲区大小创建一个新的输出流。
|
GZIPOutputStream(OutputStream out, int size, boolean syncFlush)
用指定的缓冲区大小和刷新模式创建一个新的输出流。
|
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
完成写入压缩数据到输出流,而不关闭底层流。
|
void |
write(byte[] buf, int off, int len)
将字节数组写入压缩的输出流中。
|
close, deflate, flush, writewriteprotected CRC32 crc
public GZIPOutputStream(OutputStream out, int size) throws IOException
新的输出流实例是通过调用构造函数创建3-argument GZIPOutputStream好像(,大小,假)。
out -输出流
size -输出缓冲区的大小
IOException如果发生I/O错误。
size <= 0
IllegalArgumentException
public GZIPOutputStream(OutputStream out, int size, boolean syncFlush) throws IOException
out -输出流
size -输出缓冲区的大小
syncFlush -如果
true调用继承的
flush()方法此实例冲压机冲洗方式
Deflater.SYNC_FLUSH冲洗前的输出流,否则只能刷新输出流
IOException如果发生I/O错误。
size <= 0
IllegalArgumentException
public GZIPOutputStream(OutputStream out) throws IOException
新的输出流实例是通过调用构造函数创建2-argument GZIPOutputStream好像(,假)。
out -输出流
IOException如果发生I/O错误。
public GZIPOutputStream(OutputStream out, boolean syncFlush) throws IOException
out -输出流
syncFlush -如果
true调用继承的
flush()方法此实例冲压机冲洗方式
Deflater.SYNC_FLUSH冲洗前的输出流,否则只能刷新输出流
IOException如果发生I/O错误。
public void write(byte[] buf,
int off,
int len)
throws IOException
write 方法重写,继承类
DeflaterOutputStream
buf -要写入的数据
off的起始偏移量的数据
len -数据的长度
IOException如果发生I/O错误。
FilterOutputStream.write(int)
public void finish()
throws IOException
finish 方法重写,继承类
DeflaterOutputStream
IOException如果发生I/O错误
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.