Modifier and Type | Field and Description |
---|---|
protected CRC32 | crc
CRC-32 of uncompressed data. |
private static final int | |
private static final byte | |
private static final int |
Access | Constructor and Description |
---|---|
public | GZIPOutputStream(OutputStream
the output stream out, int the output buffer size size)Creates a new output stream with the specified buffer size. |
public | GZIPOutputStream(OutputStream
the output stream out, int the output buffer size size, boolean if syncFlush)true invocation of the inherited
flush() method of
this instance flushes the compressor with flush mode
Deflater#SYNC_FLUSH before flushing the output
stream, otherwise only flushes the output streamCreates a new output stream with the specified buffer size and flush mode. |
public | GZIPOutputStream(OutputStream
the output stream out)Creates a new output stream with a default buffer size. |
public | GZIPOutputStream(OutputStream
the output stream out, boolean if syncFlush)true invocation of the inherited
flush() method of
this instance flushes the compressor with flush mode
Deflater#SYNC_FLUSH before flushing the output
stream, otherwise only flushes the output streamCreates a new output stream with a default buffer size and the specified flush mode. |
Modifier and Type | Method and Description |
---|---|
public void | finish()
Overrides java. Finishes writing compressed data to the output stream without closing the underlying stream. |
public synchronized void | write(byte[]
the data to be written buf, int the start offset of the data off, int the length of the data len)Overrides java. Writes array of bytes to the compressed output stream. |
private void | |
private void | |
private void | |
private void |
crc | back to summary |
---|---|
protected CRC32 crc CRC-32 of uncompressed data. |
GZIP_MAGIC | back to summary |
---|---|
private static final int GZIP_MAGIC |
OS_UNKNOWN | back to summary |
---|---|
private static final byte OS_UNKNOWN |
TRAILER_SIZE | back to summary |
---|---|
private static final int TRAILER_SIZE |
GZIPOutputStream | back to summary |
---|---|
public GZIPOutputStream(OutputStream out, int size) throws IOException Creates a new output stream with the specified buffer size. The new output stream instance is created as if by invoking the 3-argument constructor GZIPOutputStream(out, size, false).
|
GZIPOutputStream | back to summary |
---|---|
public GZIPOutputStream(OutputStream out, int size, boolean syncFlush) throws IOException Creates a new output stream with the specified buffer size and flush mode.
|
GZIPOutputStream | back to summary |
---|---|
public GZIPOutputStream(OutputStream out) throws IOException Creates a new output stream with a default buffer size. The new output stream instance is created as if by invoking the 2-argument constructor GZIPOutputStream(out, false).
|
GZIPOutputStream | back to summary |
---|---|
public GZIPOutputStream(OutputStream out, boolean syncFlush) throws IOException Creates a new output stream with a default buffer size and the specified flush mode.
|
finish | back to summary |
---|---|
public void finish() throws IOException Overrides java. Finishes writing compressed data to the output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.
|
write | back to summary |
---|---|
public synchronized void write(byte[] buf, int off, int len) throws IOException Overrides java. Writes array of bytes to the compressed output stream. This method will block until all the bytes are written.
|
writeHeader | back to summary |
---|---|
private void writeHeader() throws IOException |
writeInt | back to summary |
---|---|
private void writeInt(int i, byte[] buf, int offset) throws IOException |
writeShort | back to summary |
---|---|
private void writeShort(int s, byte[] buf, int offset) throws IOException |
writeTrailer | back to summary |
---|---|
private void writeTrailer(byte[] buf, int offset) throws IOException |