private static LinkedBuffer writeKey(final String name, final int indent,
            final boolean repeated, final WriteSink sink,
            final WriteSession session, LinkedBuffer lb) throws IOException
    {
        lb = sink.writeByteArray(
                COLON_AND_SPACE,
                session,
                sink.writeStrAscii(
                        name,
                        session,
                        newLine(
                                indent,
                                sink,
                                session,
                                lb)));
        if (repeated)
        {
            return sink.writeByteArray(
                    DASH_AND_SPACE,
                    session,
                    newLine(
                            inc(indent, 2),
                            sink,
                            session,
                            lb));
        }

        return lb;
    }
Before serializing a message/object tied to a schema, this should be called.
protostuff-yaml/src/main/java/io/protostuff/YamlOutput.java