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

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

java 1次浏览

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

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

示例1: get

点赞 3

import org.bouncycastle.operator.InputExpander; //导入依赖的package包/类
public InputExpander get(final AlgorithmIdentifier algorithm)
{
    return new InputExpander()
    {
        public AlgorithmIdentifier getAlgorithmIdentifier()
        {
            return algorithm;
        }

        public InputStream getInputStream(InputStream comIn)
        {
            InputStream s = new InflaterInputStream(comIn);                
            if (limit >= 0)
            {
                s = new LimitedInputStream(s, limit);
            }
            return s;
        }
    };
}
 

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

示例2: getContent

点赞 3

import org.bouncycastle.operator.InputExpander; //导入依赖的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

示例3: getContent

点赞 3

import org.bouncycastle.operator.InputExpander; //导入依赖的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)