All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Direct Known Subclasses:
ReusableGZIPOutputStream

public class ResettableGZIPOutputStreamextends DeflaterOutputStream
GZIP implementation per RFC 1952, reusing java's standard CRC32 and Deflater implementations. The main difference is that this implementation allows its state to be reset to initial values, and hence reused, while the standard GZIPOutputStream writes the GZIP header to the stream on instantiation, rather than on first write.
  • Field Details

    • _headerWritten

      private boolean _headerWritten
      Has the header been written out yet?
    • _footerWritten

      private boolean _footerWritten
      True once the gzip footer has been written.
    • _writtenSize

      private long _writtenSize
      How much data is in the uncompressed stream?
    • _crc32

      private final CRC32 _crc32
      Checksum of the bytes written.
    • DEBUG

      private static final boolean DEBUG
      True to log the stream's internals.
      See Also:
  • Constructor Details

    • ResettableGZIPOutputStream

      public ResettableGZIPOutputStream(OutputStream o)
      Stream writing gzip data to the given output stream.
      Parameters:
      o - the underlying output stream
  • Method Details