• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java InputExpanderProvider类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.bouncycastle.operator.InputExpanderProvider的典型用法代码示例。如果您正苦于以下问题:Java InputExpanderProvider类的具体用法?Java InputExpanderProvider怎么用?Java InputExpanderProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

InputExpanderProvider类属于org.bouncycastle.operator包,在下文中一共展示了InputExpanderProvider类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getContent

点赞 3

import org.bouncycastle.operator.InputExpanderProvider; //导入依赖的package包/类
/**
 * Return a typed stream which will allow the reading of the compressed content in
 * expanded form.
 *
 * @param expanderProvider a provider of expander algorithm implementations.
 * @return a type stream which will yield the un-compressed content.
 * @throws CMSException if there is an exception parsing the CompressedData object.
 */
public CMSTypedStream  getContent(InputExpanderProvider expanderProvider)
    throws CMSException
{
    try
    {
        CompressedDataParser  comData = new CompressedDataParser((ASN1SequenceParser)_contentInfo.getContent(BERTags.SEQUENCE));
        ContentInfoParser     content = comData.getEncapContentInfo();
        InputExpander expander = expanderProvider.get(comData.getCompressionAlgorithmIdentifier());

        ASN1OctetStringParser bytes = (ASN1OctetStringParser)content.getContent(BERTags.OCTET_STRING);

        return new CMSTypedStream(content.getContentType().getId(), expander.getInputStream(bytes.getOctetStream()));
    }
    catch (IOException e)
    {
        throw new CMSException("IOException reading compressed content.", e);
    }
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:27,
代码来源:CMSCompressedDataParser.java

示例2: getContent

点赞 3

import org.bouncycastle.operator.InputExpanderProvider; //导入依赖的package包/类
/**
 * Return the uncompressed content.
 *
 * @param expanderProvider a provider of expander algorithm implementations.
 * @return the uncompressed content
 * @throws CMSException if there is an exception un-compressing the data.
 */
public byte[] getContent(InputExpanderProvider expanderProvider)
    throws CMSException
{
    ContentInfo     content = comData.getEncapContentInfo();

    ASN1OctetString bytes = (ASN1OctetString)content.getContent();
    InputExpander   expander = expanderProvider.get(comData.getCompressionAlgorithmIdentifier());
    InputStream     zIn = expander.getInputStream(bytes.getOctetStream());

    try
    {
        return CMSUtils.streamToByteArray(zIn);
    }
    catch (IOException e)
    {
        throw new CMSException("exception reading compressed stream.", e);
    }
}
 

开发者ID:Appdome,
项目名称:ipack,
代码行数:26,
代码来源:CMSCompressedData.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)