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