<dependency>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-yaml</artifactId>
<version>1.1.0</version>
</dependency>
public class Person {
private String name;
private int age;
}
LinkedBuffer buffer = LinkedBuffer.allocate();
Schema<Person> schema = RuntimeSchema.getSchema(Person.class);
ByteArrayOutputStream os = new ByteArrayOutputStream();
YamlIOUtil.writeTo(os, person, schema, buffer);
String yaml = new String(os.toByteArray(), StandardCharsets.UTF_8);
System.out.println(yaml);
byte[] bytes = yaml.getBytes(StandardCharsets.UTF_8);
Person person = new Person();
YamlIOUtil.mergeFrom(bytes, person, schema);