public class PGPCompressedData extends java.lang.Object implements CompressionAlgorithmTags
BZIP2, UNCOMPRESSED, ZIP, ZLIB
Constructor and Description |
---|
PGPCompressedData(BCPGInputStream pIn)
Construct a compressed data object, reading a single
PacketTags.COMPRESSED_DATA
packet from the stream. |
PGPCompressedData(byte[] encData)
Construct a PGP compressed data object from the passed in byte array.
|
PGPCompressedData(java.io.InputStream inStream)
Construct a PGP compressed data object from the passed in input stream.
|
Modifier and Type | Method and Description |
---|---|
int |
getAlgorithm()
Return the
compression algorithm used for this packet. |
java.io.InputStream |
getDataStream()
Return an input stream that decompresses and returns data in the compressed packet.
|
java.io.InputStream |
getInputStream()
Return the raw input stream contained in the object.
|
public PGPCompressedData(byte[] encData) throws java.io.IOException
encData
- an encoding of PGP compressed data.java.io.IOException
- if an error occurs reading from the PGP input.public PGPCompressedData(java.io.InputStream inStream) throws java.io.IOException
inStream
- an input stream containing an encoding of PGP compressed data.java.io.IOException
- if an error occurs reading from the PGP input.public PGPCompressedData(BCPGInputStream pIn) throws java.io.IOException
PacketTags.COMPRESSED_DATA
packet from the stream.pIn
- a PGP input stream, with a compressed data packet as the current packet.java.io.IOException
- if an error occurs reading the packet from the stream.public int getAlgorithm()
compression algorithm
used for this packet.public java.io.InputStream getInputStream()
Note that this stream is shared with the decompression stream, so consuming the returned stream will affect decompression.
public java.io.InputStream getDataStream() throws PGPException
PGPException
- if an error occurs constructing the decompression stream.