gpt4 book ai didi

io.protostuff.YamlIOUtil.writeTo()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 16:47:31 27 4
gpt4 key购买 nike

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

YamlIOUtil.writeTo介绍

[英]Serializes the message into the LinkedBuffer.
[中]将消息序列化到LinkedBuffer中。

代码示例

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

public <T> int writeTo(OutputStream out, T message, Schema<T> schema) throws IOException
{
  return YamlIOUtil.writeTo(out, message, schema, buf());
}

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

@Override
public <T extends Message<T>> byte[] serialize(T message)
{
  try
  {
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    YamlIOUtil.writeTo(out, message, message.cachedSchema(), buffer);
    return out.toByteArray();
  }
  catch (IOException e)
  {
    throw new RuntimeException(e);
  }
  finally
  {
    buffer.clear();
  }
}

代码示例来源:origin: NationalSecurityAgency/datawave

XmlIOUtil.writeTo(out, message, schema);
} else if ("text/yaml".equals(media.toString()) || "text/x-yaml".equals(media.toString()) || "application/x-yaml".equals(media.toString())) {
  YamlIOUtil.writeTo(out, message, schema, buffer);
} else if ("application/x-protobuf".equals(media.toString())) {
  ProtobufIOUtil.writeTo(out, message, schema, buffer);

代码示例来源:origin: NationalSecurityAgency/datawave

Message<Object> yaml = (Message<Object>) page;
Schema<Object> yamlSchema = yaml.cachedSchema();
YamlIOUtil.writeTo(countingStream, page, yamlSchema, buffer);
buffer.clear();
break;

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com