CMSCompressedDataStreamGenerator (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.cms

## Class CMSCompressedDataStreamGenerator

- java.lang.Object
- - org.bouncycastle.cms.CMSCompressedDataStreamGenerator

-     public class CMSCompressedDataStreamGenerator
      extends java.lang.Object

  General class for generating a compressed CMS message stream.

  A simple example of usage.

            CMSCompressedDataStreamGenerator gen = new CMSCompressedDataStreamGenerator();

            OutputStream cOut = gen.open(outputStream, new ZlibCompressor());

            cOut.write(data);

            cOut.close();

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ZLIB`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CMSCompressedDataStreamGenerator()` base constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.io.OutputStream` | `open(org.bouncycastle.asn1.ASN1ObjectIdentifier contentOID, java.io.OutputStream out, OutputCompressor compressor)` Open a compressing output stream.
    `java.io.OutputStream` | `open(java.io.OutputStream out, OutputCompressor compressor)` Open a compressing output stream with the PKCS#7 content type OID of "data".
    `void` | `setBufferSize(int bufferSize)` Set the underlying string size for encapsulated data

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ZLIB

          public static final java.lang.String ZLIB

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CMSCompressedDataStreamGenerator

          public CMSCompressedDataStreamGenerator()

      base constructor

  - ### Method Detail

    - #### setBufferSize

          public void setBufferSize(int bufferSize)

      Set the underlying string size for encapsulated data
      Parameters:
        `bufferSize` - length of octet strings to buffer the data.

    - #### open

          public java.io.OutputStream open(java.io.OutputStream out,
                                  OutputCompressor compressor)
                                    throws java.io.IOException

      Open a compressing output stream with the PKCS#7 content type OID of "data".
      Parameters:
        `out` - the stream to encode to.
        `compressor` - the type of compressor to use.
      Returns:
        an output stream to write the data be compressed to.
      Throws:
        `java.io.IOException`

    - #### open

          public java.io.OutputStream open(org.bouncycastle.asn1.ASN1ObjectIdentifier contentOID,
                                  java.io.OutputStream out,
                                  OutputCompressor compressor)
                                    throws java.io.IOException

      Open a compressing output stream.
      Parameters:
        `contentOID` - the content type OID.
        `out` - the stream to encode to.
        `compressor` - the type of compressor to use.
      Returns:
        an output stream to write the data be compressed to.
      Throws:
        `java.io.IOException`