com.fasterxml.jackson.databind.node.TextNode.getBinaryValue()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(102)

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

TextNode.getBinaryValue介绍

[英]Method for accessing textual contents assuming they were base64 encoded; if so, they are decoded and resulting binary data is returned.
[中]假设文本内容是base64编码的,用于访问文本内容的方法;如果是这样,则对它们进行解码,并返回生成的二进制数据。

代码示例

代码示例来源:origin: redisson/redisson

@Override
public byte[] binaryValue() throws IOException {
  return getBinaryValue(Base64Variants.getDefaultVariant());
}

代码示例来源:origin: redisson/redisson

@Override
public byte[] getBinaryValue(Base64Variant b64variant)
  throws IOException, JsonParseException
{
  // Multiple possibilities...
  JsonNode n = currentNode();
  if (n != null) {
    // [databind#2096]: although `binaryValue()` works for real binary node
    // and embedded "POJO" node, coercion from TextNode may require variant, so:
    if (n instanceof TextNode) {
      return ((TextNode) n).getBinaryValue(b64variant);
    }
    return n.binaryValue();
  }
  // otherwise return null to mark we have no binary content
  return null;
}

代码示例来源:origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

@Override
public byte[] binaryValue() throws IOException
{
  return getBinaryValue(Base64Variants.getDefaultVariant());
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public byte[] binaryValue() throws IOException
{
  return getBinaryValue(Base64Variants.getDefaultVariant());
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

@Override
public byte[] binaryValue() throws IOException {
  return getBinaryValue(Base64Variants.getDefaultVariant());
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

@Override
public byte[] binaryValue() throws IOException {
  return getBinaryValue(Base64Variants.getDefaultVariant());
}

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

@Override
public byte[] binaryValue() throws IOException {
  return getBinaryValue(Base64Variants.getDefaultVariant());
}

代码示例来源:origin: Nextdoor/bender

@Override
public byte[] binaryValue() throws IOException {
  return getBinaryValue(Base64Variants.getDefaultVariant());
}

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

@Override
public byte[] getBinaryValue(Base64Variant b64variant)
  throws IOException, JsonParseException
{
  // Multiple possibilities...
  JsonNode n = currentNode();
  if (n != null) {
    // [databind#2096]: although `binaryValue()` works for real binary node
    // and embedded "POJO" node, coercion from TextNode may require variant, so:
    if (n instanceof TextNode) {
      return ((TextNode) n).getBinaryValue(b64variant);
    }
    return n.binaryValue();
  }
  // otherwise return null to mark we have no binary content
  return null;
}

相关文章