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

CMSCompressedDataParser

public class CMSCompressedDataParser extends CMSContentInfoParser
Class for reading a CMS Compressed Data stream.
CMSCompressedDataParser cp = new CMSCompressedDataParser(inputStream);

process(cp.getContent().getContentStream());
Note: this class does not introduce buffering - if you are processing large files you should create the parser with:
CMSCompressedDataParser ep = new CMSCompressedDataParser(new BufferedInputStream(inputStream, bufSize));
where bufSize is a suitably large buffer size.

Fields Summary
Constructors Summary
public CMSCompressedDataParser(byte[] compressedData)

        this(new ByteArrayInputStream(compressedData));
    
public CMSCompressedDataParser(InputStream compressedData)

        super(compressedData);
    
Methods Summary
public CMSTypedStreamgetContent()

        try
        {
            CompressedDataParser  comData = new CompressedDataParser((ASN1SequenceParser)_contentInfo.getContent(DERTags.SEQUENCE));
            ContentInfoParser     content = comData.getEncapContentInfo();
    
            ASN1OctetStringParser bytes = (ASN1OctetStringParser)content.getContent(DERTags.OCTET_STRING);
    
            return new CMSTypedStream(content.getContentType().toString(), new InflaterInputStream(bytes.getOctetStream()));
        }
        catch (IOException e)
        {
            throw new CMSException("IOException reading compressed content.", e);
        }