public class GZIPOutputStream extends DeflaterOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected CRC32 |
crc
CRC-32 value for uncompressed data
|
buf, def| Constructor and Description |
|---|
GZIPOutputStream(java.io.OutputStream out)
Creates a GZIPOutputStream with the default buffer size
|
GZIPOutputStream(java.io.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, writepublic GZIPOutputStream(java.io.OutputStream out) throws java.io.IOException
out - The stream to read data (to be compressed) fromjava.io.IOExceptionpublic GZIPOutputStream(java.io.OutputStream out, int size) throws java.io.IOException
out - The stream to read compressed data fromsize - Size of the buffer to usejava.io.IOExceptionpublic void write(byte[] buf, int off, int len) throws java.io.IOException
DeflaterOutputStreamwrite in class DeflaterOutputStreambuf - the byte array.off - the offset into the byte array where to start.len - the number of bytes to write.java.io.IOException - If an error occurspublic void close() throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class DeflaterOutputStreamjava.io.IOException - If an error occurspublic void finish() throws java.io.IOException
DeflaterOutputStreamfinish in class DeflaterOutputStreamjava.io.IOException