public class GZIPOutputStream extends DeflaterOutputStream
Modifier and Type | Field and Description |
---|---|
protected CRC32 |
crc
CRC-32 value for uncompressed data
|
buf, def
out
Constructor and Description |
---|
GZIPOutputStream(OutputStream out) |
GZIPOutputStream(OutputStream out,
int size)
Creates a GZIPOutputStream with the specified buffer size
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Writes remaining compressed output data to the output stream and closes
it.
|
void |
finish()
Finishes the stream by calling finish() on the deflater.
|
void |
write(byte[] buf,
int off,
int len)
Writes a len bytes from an array to the compressed stream.
|
deflate, flush, write
write
protected CRC32 crc
public GZIPOutputStream(OutputStream out) throws IOException
IOException
public GZIPOutputStream(OutputStream out, int size) throws IOException
out
- The stream to read compressed data fromsize
- Size of the buffer to useIOException
public void write(byte[] buf, int off, int len) throws IOException
DeflaterOutputStream
write
in class DeflaterOutputStream
buf
- the byte array.off
- the offset into the byte array where to start.len
- the number of bytes to write.IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class DeflaterOutputStream
IOException
public void finish() throws IOException
DeflaterOutputStream
finish
in class DeflaterOutputStream
IOException
Copyright © 2009–2017. All rights reserved.