docs: public static <T> byte[] toByteArray(T message, Schema<T> schema, LinkedBuffer buffer)
      {
          if (buffer.start != buffer.offset)
              throw new IllegalArgumentException("Buffer previously used and had not been reset.");
  
          final XmlXOutput output = new XmlXOutput(buffer, schema);
  
          final String name = schema.messageName();
          try
          {
              // header and start root element
              output.tail = output.sink.writeByte(XmlXOutput.END_TAG, output,
                      output.sink.writeStrAscii(name, output,
                              output.sink.writeByte(XmlXOutput.START_TAG, output,
                                      output.sink.writeByteArray(HEADER, output, output.tail))));
  
              schema.writeTo(output, message);
  
              // end root element
              output.tail = output.sink.writeByte(XmlXOutput.END_TAG, output,
                      output.sink.writeStrAscii(name, output,
                              output.sink.writeByteArray(XmlXOutput.START_SLASH_TAG, output, output.tail)));
          }
          catch (IOException e)
          {
              throw new RuntimeException("Serializing to a byte array threw an IOException " +
                      "(should never happen).", e);
          }
  
          return output.toByteArray();
      }