org.spongycastle.asn1.ASN1OctetString.getOctetStream()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中org.spongycastle.asn1.ASN1OctetString.getOctetStream()方法的一些代码示例,展示了ASN1OctetString.getOctetStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ASN1OctetString.getOctetStream()方法的具体详情如下:
包路径:org.spongycastle.asn1.ASN1OctetString
类名称:ASN1OctetString
方法名:getOctetStream

ASN1OctetString.getOctetStream介绍

[英]Return the content of the OCTET STRING as an InputStream.
[中]以InputStream的形式返回八位字节字符串的内容。

代码示例

代码示例来源:origin: com.madgag.spongycastle/pkix

/**
 * 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);
  }
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

/**
 * 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);
  }
}

相关文章