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 themessageinto a byte array with the supplied buffer.static <T> intwriteListTo(LinkedBuffer buffer, List<T> messages, Schema<T> schema) Serializes themessagesaLinkedBufferusing the given schema.static <T> intwriteListTo(OutputStream out, 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(OutputStream out, T message, Schema<T> schema, LinkedBuffer buffer) Serializes themessageinto anOutputStreamwith the supplied buffer.
-
Field Details
-
START_DIRECTIVE
private static final byte[] START_DIRECTIVE
-
-
Constructor Details
-
YamlIOUtil
public YamlIOUtil()
-
-
Method Details
-
toByteArray
Serializes themessageinto a byte array with the supplied buffer. -
writeTo
Serializes themessageinto 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 themessageinto anOutputStreamwith the supplied buffer.- Returns:
- the total bytes written to the output.
- Throws:
IOException
-
writeListTo
Serializes themessagesaLinkedBufferusing 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 themessagesinto anOutputStreamusing the given schema with the supplied buffer.- Returns:
- the total bytes written to the output.
- Throws:
IOException
-