Example usage for org.bouncycastle.cms CMSCompressedDataParser getContent

List of usage examples for org.bouncycastle.cms CMSCompressedDataParser getContent

Introduction

In this page you can find the example usage for org.bouncycastle.cms CMSCompressedDataParser getContent.

Prototype

public CMSTypedStream getContent(InputExpanderProvider expanderProvider) throws CMSException 

Source Link

Document

Return a typed stream which will allow the reading of the compressed content in expanded form.

Usage

From source file:de.mendelson.util.security.BCCryptoHelper.java

/**
 * Uncompresses a data stream//from   w  w  w.j a  v  a  2 s .co  m
 */
public void uncompressCMS(InputStream compressed, OutputStream uncompressed) throws Exception {
    CMSCompressedDataParser compressedParser = new CMSCompressedDataParser(new BufferedInputStream(compressed));
    this.copyStreams(compressedParser.getContent(new ZlibExpanderProvider()).getContentStream(), uncompressed);
    uncompressed.flush();
}