Package io.protostuff
Class YamlIOUtil
- java.lang.Object
-
- io.protostuff.YamlIOUtil
-
public final class YamlIOUtil extends java.lang.Object
Utility for the YAML serialization of messages and objects tied to a schema.
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
START_DIRECTIVE
-
Constructor Summary
Constructors Constructor Description YamlIOUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> byte[]
toByteArray(T message, Schema<T> schema, LinkedBuffer buffer)
Serializes themessage
into a byte array with the supplied buffer.static <T> int
writeListTo(LinkedBuffer buffer, java.util.List<T> messages, Schema<T> schema)
Serializes themessages
aLinkedBuffer
using the given schema.static <T> int
writeListTo(java.io.OutputStream out, java.util.List<T> messages, Schema<T> schema, LinkedBuffer buffer)
Serializes themessages
into anOutputStream
using the given schema with the supplied buffer.static <T> int
writeTo(LinkedBuffer buffer, T message, Schema<T> schema)
Serializes themessage
into theLinkedBuffer
.static <T> int
writeTo(java.io.OutputStream out, T message, Schema<T> schema, LinkedBuffer buffer)
Serializes themessage
into anOutputStream
with the supplied buffer.
-
-
-
Method Detail
-
toByteArray
public static <T> byte[] toByteArray(T message, Schema<T> schema, LinkedBuffer buffer)
Serializes themessage
into a byte array with the supplied buffer.
-
writeTo
public static <T> int writeTo(LinkedBuffer buffer, T message, Schema<T> schema)
Serializes themessage
into theLinkedBuffer
.- Returns:
- the total bytes written to the output.
-
writeTo
public static <T> int writeTo(java.io.OutputStream out, T message, Schema<T> schema, LinkedBuffer buffer) throws java.io.IOException
Serializes themessage
into anOutputStream
with the supplied buffer.- Returns:
- the total bytes written to the output.
- Throws:
java.io.IOException
-
writeListTo
public static <T> int writeListTo(LinkedBuffer buffer, java.util.List<T> messages, Schema<T> schema)
Serializes themessages
aLinkedBuffer
using the given schema.- Returns:
- the total bytes written to the output.
-
writeListTo
public static <T> int writeListTo(java.io.OutputStream out, java.util.List<T> messages, Schema<T> schema, LinkedBuffer buffer) throws java.io.IOException
Serializes themessages
into anOutputStream
using the given schema with the supplied buffer.- Returns:
- the total bytes written to the output.
- Throws:
java.io.IOException
-
-