Bouncy Castle Cryptography 1.30

org.bouncycastle.openpgp
Class PGPCompressedDataGenerator

java.lang.Object
  |
  +--org.bouncycastle.openpgp.PGPCompressedDataGenerator
All Implemented Interfaces:
CompressionAlgorithmTags

public class PGPCompressedDataGenerator
extends java.lang.Object
implements CompressionAlgorithmTags

class for producing compressed data packets.


Fields inherited from interface org.bouncycastle.bcpg.CompressionAlgorithmTags
UNCOMPRESSED, ZIP, ZLIB
 
Constructor Summary
PGPCompressedDataGenerator(int algorithm)
           
PGPCompressedDataGenerator(int algorithm, int compression)
           
 
Method Summary
 void close()
          Close the compressed object.
 java.io.OutputStream open(java.io.OutputStream out)
          Return an outputstream which will save the data being written to the compressed object.
 java.io.OutputStream open(java.io.OutputStream out, byte[] buffer)
          Return an outputstream which will compress the data as it is written to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPCompressedDataGenerator

public PGPCompressedDataGenerator(int algorithm)

PGPCompressedDataGenerator

public PGPCompressedDataGenerator(int algorithm,
                                  int compression)
Method Detail

open

public java.io.OutputStream open(java.io.OutputStream out)
                          throws java.io.IOException
Return an outputstream which will save the data being written to the compressed object.
Parameters:
out -  
Returns:
OutputStream
Throws:
java.io.IOException -  

open

public java.io.OutputStream open(java.io.OutputStream out,
                                 byte[] buffer)
                          throws java.io.IOException,
                                 PGPException
Return an outputstream which will compress the data as it is written to it. The stream will be written out in chunks according to the size of the passed in buffer.

Note: if the buffer is not a power of 2 in length only the largest power of 2 bytes worth of the buffer will be used.

Note: using this may break compatability with RFC 1991 compliant tools. Only recent OpenPGP implementations are capable of accepting these streams.

Parameters:
out -  
buffer - the buffer to use.
Returns:
OutputStream
Throws:
java.io.IOException -  
PGPException -  

close

public void close()
           throws java.io.IOException
Close the compressed object.
Throws:
java.io.IOException -  

Bouncy Castle Cryptography 1.30