Top Description Fields Constructors Methods
org.bouncycastle.openpgp

public Class PGPCompressedData

extends Object
implements CompressionAlgorithmTags
Class Inheritance
All Implemented Interfaces
org.bouncycastle.bcpg.CompressionAlgorithmTags
Imports
java.io.ByteArrayInputStream, .EOFException, .IOException, .InputStream, java.util.zip.Inflater, .InflaterInputStream, org.bouncycastle.apache.bzip2.CBZip2InputStream, org.bouncycastle.bcpg.BCPGInputStream, .CompressedDataPacket, .CompressionAlgorithmTags, .Packet, .PacketTags

A PGP compressed data object.

Field Summary

Modifier and TypeField and Description
pack-priv CompressedDataPacket

Constructor Summary

AccessConstructor and Description
public
PGPCompressedData(byte[]
an encoding of PGP compressed data.
encData
)

Construct a PGP compressed data object from the passed in byte array.

public
PGPCompressedData(InputStream
an input stream containing an encoding of PGP compressed data.
inStream
)

Construct a PGP compressed data object from the passed in input stream.

public
PGPCompressedData(BCPGInputStream
a PGP input stream, with a compressed data packet as the current packet.
pIn
)

Construct a compressed data object, reading a single PacketTags#COMPRESSED_DATA packet from the stream.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the compression algorithm code
getAlgorithm
()

Return the compression algorithm used for this packet.

public InputStream

Returns:

a stream over the uncompressed data.
getDataStream
()

Return an input stream that decompresses and returns data in the compressed packet.

public InputStream

Returns:

the raw data in the compressed data packet.
getInputStream
()

Return the raw input stream contained in the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
pack-priv CompressedDataPacket data

Constructor Detail

PGPCompressedDataback to summary
public PGPCompressedData(byte[] encData) throws IOException

Construct a PGP compressed data object from the passed in byte array.

Parameters
encData:byte[]

an encoding of PGP compressed data.

Exceptions
IOException:
if an error occurs reading from the PGP input.
PGPCompressedDataback to summary
public PGPCompressedData(InputStream inStream) throws IOException

Construct a PGP compressed data object from the passed in input stream.

Parameters
inStream:InputStream

an input stream containing an encoding of PGP compressed data.

Exceptions
IOException:
if an error occurs reading from the PGP input.
PGPCompressedDataback to summary
public PGPCompressedData(BCPGInputStream pIn) throws IOException

Construct a compressed data object, reading a single PacketTags#COMPRESSED_DATA packet from the stream.

Parameters
pIn:BCPGInputStream

a PGP input stream, with a compressed data packet as the current packet.

Exceptions
IOException:
if an error occurs reading the packet from the stream.

Method Detail

getAlgorithmback to summary
public int getAlgorithm()

Return the compression algorithm used for this packet.

Returns:int

the compression algorithm code

getDataStreamback to summary
public InputStream getDataStream() throws PGPException

Return an input stream that decompresses and returns data in the compressed packet.

Returns:InputStream

a stream over the uncompressed data.

Exceptions
PGPException:
if an error occurs constructing the decompression stream.
getInputStreamback to summary
public InputStream getInputStream()

Return the raw input stream contained in the object.

Note that this stream is shared with the decompression stream, so consuming the returned stream will affect decompression.

Returns:InputStream

the raw data in the compressed data packet.