FileDocCategorySizeDatePackage
CMSCompressedData.javaAPI DocBouncy Castle Crypto API 1.41 (Java 1.5)1867Wed Oct 01 10:55:28 BST 2008org.bouncycastle.cms

CMSCompressedData

public class CMSCompressedData extends Object
containing class for an CMS Compressed Data object

Fields Summary
org.bouncycastle.asn1.cms.ContentInfo
contentInfo
Constructors Summary
public CMSCompressedData(byte[] compressedData)

        this(CMSUtils.readContentInfo(compressedData));
    
public CMSCompressedData(InputStream compressedData)

        this(CMSUtils.readContentInfo(compressedData));
    
public CMSCompressedData(org.bouncycastle.asn1.cms.ContentInfo contentInfo)

        this.contentInfo = contentInfo;
    
Methods Summary
public byte[]getContent()

        CompressedData  comData = CompressedData.getInstance(contentInfo.getContent());
        ContentInfo     content = comData.getEncapContentInfo();

        ASN1OctetString bytes = (ASN1OctetString)content.getContent();

        InflaterInputStream     zIn = new InflaterInputStream(new ByteArrayInputStream(bytes.getOctets()));

        try
        {
            return CMSUtils.streamToByteArray(zIn);
        }
        catch (IOException e)
        {
            throw new CMSException("exception reading compressed stream.", e);
        }
    
public org.bouncycastle.asn1.cms.ContentInfogetContentInfo()
return the ContentInfo

        return contentInfo;
    
public byte[]getEncoded()
return the ASN.1 encoded representation of this object.

        return contentInfo.getEncoded();