Package io.protostuff

Class YamlIOUtil

java.lang.Object
io.protostuff.YamlIOUtil

public final class YamlIOUtil extends Object
Utility for the YAML serialization of messages and objects tied to a schema.
  • Field Details

    • START_DIRECTIVE

      private static final byte[] START_DIRECTIVE
  • Constructor Details

    • YamlIOUtil

      public YamlIOUtil()
  • Method Details

    • toByteArray

      public static <T> byte[] toByteArray(T message, Schema<T> schema, LinkedBuffer buffer)
      Serializes the message into a byte array with the supplied buffer.
    • writeTo

      public static <T> int writeTo(LinkedBuffer buffer, T message, Schema<T> schema)
      Serializes the message into the LinkedBuffer.
      Returns:
      the total bytes written to the output.
    • writeTo

      public static <T> int writeTo(OutputStream out, T message, Schema<T> schema, LinkedBuffer buffer) throws IOException
      Serializes the message into an OutputStream with the supplied buffer.
      Returns:
      the total bytes written to the output.
      Throws:
      IOException
    • writeListTo

      public static <T> int writeListTo(LinkedBuffer buffer, List<T> messages, Schema<T> schema)
      Serializes the messages a LinkedBuffer using the given schema.
      Returns:
      the total bytes written to the output.
    • writeListTo

      public static <T> int writeListTo(OutputStream out, List<T> messages, Schema<T> schema, LinkedBuffer buffer) throws IOException
      Serializes the messages into an OutputStream using the given schema with the supplied buffer.
      Returns:
      the total bytes written to the output.
      Throws:
      IOException