public class CompressedDataOutputStreamDemo extends java.lang.Object
CompressedDataOutputStream
and
CompressedDataOutputStream
for compressing data using
the CMS type CompressedData.CompressedDataOutputStream
,
CompressedDataStream
Constructor and Description |
---|
CompressedDataOutputStreamDemo()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
createCompressedData(byte[] message)
Uses the IAIK-CMS CompressedDataOutputStream class to create a CMS
CompressedData object for compressing the given message. |
byte[] |
getCompressedData(byte[] encoding)
Parses a CMS
CompressedData object. |
static void |
main(java.lang.String[] argv)
Main method.
|
void |
start()
Starts the demo.
|
public CompressedDataOutputStreamDemo()
public byte[] createCompressedData(byte[] message) throws iaik.cms.CMSException, java.io.IOException
CompressedData
object for compressing the given message.
message
- the message to be compressed, as byte representationCompressedData
object just creatediaik.cms.CMSException
- if the CompressedData
object cannot
be createdjava.io.IOException
- if an I/O error occurspublic byte[] getCompressedData(byte[] encoding) throws iaik.cms.CMSException, java.io.IOException, java.security.NoSuchAlgorithmException
CompressedData
object.encoding
- the CompressedData
object as BER encoded byte arrayiaik.cms.CMSException
- if the CompressedData cannot be parsedjava.io.IOException
- if an I/O error occursjava.security.NoSuchAlgorithmException
- if the compression algorithm is not supportedpublic void start()
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception