Package io.protostuff
Class YamlIOUtil
- java.lang.Object
-
- io.protostuff.YamlIOUtil
-
public final class YamlIOUtil extends java.lang.ObjectUtility 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 themessageinto a byte array with the supplied buffer.static <T> intwriteListTo(LinkedBuffer buffer, java.util.List<T> messages, Schema<T> schema)Serializes themessagesaLinkedBufferusing the given schema.static <T> intwriteListTo(java.io.OutputStream out, java.util.List<T> messages, Schema<T> schema, LinkedBuffer buffer)Serializes themessagesinto anOutputStreamusing the given schema with the supplied buffer.static <T> intwriteTo(LinkedBuffer buffer, T message, Schema<T> schema)Serializes themessageinto theLinkedBuffer.static <T> intwriteTo(java.io.OutputStream out, T message, Schema<T> schema, LinkedBuffer buffer)Serializes themessageinto anOutputStreamwith the supplied buffer.
-
-
-
Method Detail
-
toByteArray
public static <T> byte[] toByteArray(T message, Schema<T> schema, LinkedBuffer buffer)Serializes themessageinto a byte array with the supplied buffer.
-
writeTo
public static <T> int writeTo(LinkedBuffer buffer, T message, Schema<T> schema)
Serializes themessageinto 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.IOExceptionSerializes themessageinto anOutputStreamwith 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 themessagesaLinkedBufferusing 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.IOExceptionSerializes themessagesinto anOutputStreamusing the given schema with the supplied buffer.- Returns:
- the total bytes written to the output.
- Throws:
java.io.IOException
-
-