Class PGPCompressedDataGenerator

  • All Implemented Interfaces:
    CompressionAlgorithmTags

    public class PGPCompressedDataGenerator
    extends java.lang.Object
    implements CompressionAlgorithmTags
    Generator for producing compressed data packets.

    A PGPCompressedDataGenerator is used by invoking one of the open functions to create an OutputStream that raw data can be supplied to for compression:

    If the data needs to written out in blocks, use open(OutputStream, byte[]) to create a packet consisting of a series of compressed data objects (partials).

A PGPCompressedDataGenerator is usually used to wrap the OutputStream obtained from a PGPEncryptedDataGenerator (i.e. to compress data prior to encrypting it).

Raw data is not typically written directly to the OutputStream obtained from a PGPCompressedDataGenerator. The OutputStream is usually wrapped by a PGPLiteralDataGenerator, which encodes the raw data prior to compression.

Once data for compression has been written to the constructed OutputStream, writing of the object stream is completed by closing the OutputStream obtained from the #open() method, or equivalently invoking close() on this generator.