java.util.zip.GZIPOutputStream that
reuses underlying java.util.zip.Deflater instance}.
| Modifier and Type | Field and Description |
|---|---|
| protected CRC32 | |
| protected Deflater | |
| protected DeflaterOutputStream | |
| protected final byte[] | |
| protected final GZIPRecycler | |
| protected OutputStream | _rawOut
Underlying output stream that header, compressed content and footer go to |
| pack-priv static final byte[] | DEFAULT_HEADER
For now, static header seems fine, since JDK default gzip writer does it too: |
| private static final int | GZIP_MAGIC
GZIP header magic number; written out LSB like most everything else (i.e. as 0x1f 0x8b) |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static final void | _putInt(byte[] buf, int offset, int value)
Stupid GZIP, writes stuff in wrong order (not network, but x86) |
| private void | |
| public void | close()
Overrides java. Implements java. |
| public void | flush()
Overrides java. Implements java. |
| public final void | write(byte[]
the data. buf)Overrides java. b.length bytes from the specified byte array
to this output stream.
|
| public final void | write(int
the c)byte.Implements abstract java. |
| public void | write(byte[]
the data. buf, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. len bytes from the specified byte array
starting at offset off to this output stream.
|
| _crc | back to summary |
|---|---|
| protected CRC32 _crc | |
| _deflater | back to summary |
|---|---|
| protected Deflater _deflater | |
| _deflaterOut | back to summary |
|---|---|
| protected DeflaterOutputStream _deflaterOut | |
| _eightByteBuffer | back to summary |
|---|---|
| protected final byte[] _eightByteBuffer | |
| _gzipRecycler | back to summary |
|---|---|
| protected final GZIPRecycler _gzipRecycler | |
| _rawOut | back to summary |
|---|---|
| protected OutputStream _rawOut Underlying output stream that header, compressed content and footer go to | |
| DEFAULT_HEADER | back to summary |
|---|---|
| pack-priv static final byte[] DEFAULT_HEADER For now, static header seems fine, since JDK default gzip writer does it too: | |
| GZIP_MAGIC | back to summary |
|---|---|
| private static final int GZIP_MAGIC GZIP header magic number; written out LSB like most everything else (i.e. as 0x1f 0x8b) | |
| OptimizedGZIPOutputStream | back to summary |
|---|---|
| public OptimizedGZIPOutputStream(OutputStream out) throws IOException | |
| _putInt | back to summary |
|---|---|
| private static final void _putInt(byte[] buf, int offset, int value) Stupid GZIP, writes stuff in wrong order (not network, but x86) | |
| _writeTrailer | back to summary |
|---|---|
| private void _writeTrailer(OutputStream out) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| write | back to summary |
|---|---|
| public final void write(byte[] buf) throws IOException Overrides java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public final void write(int c) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] buf, int off, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |