code: public static <T> int writeListTo(OutputStream out, List<T> messages, 
              Schema<T> schema, LinkedBuffer buffer) throws IOException
      {
          if(buffer.start != buffer.offset)
              throw new IllegalArgumentException("Buffer previously used and had not been reset.");
          
          final YamlOutput output = new YamlOutput(buffer, out, schema);
  
          output.tail = YamlOutput.writeTag(
                  schema.messageName(), 
                  true, 
                  output.sink, 
                  output, 
                  output.sink.writeByteArray(
                          START_DIRECTIVE, 
                          output, 
                          buffer));
          
          for(T m : messages)
          {
              schema.writeTo(output.writeSequenceDelim(), m);
              LinkedBuffer.writeTo(out, buffer);
              output.clear(true, false);
          }
          
          return output.getSize();
      }
docs: Serializes the {@code messages} into an {@link OutputStream}
  using the given schema with the supplied buffer.
  
  @return the total bytes written to the output.