docs: public static <T> byte[] toByteArray(T message, Schema<T> schema,
              XMLOutputFactory outFactory)
      {
          final ByteArrayOutputStream out = new ByteArrayOutputStream();
          try
          {
              writeTo(out, message, schema, outFactory);
          }
          catch (IOException e)
          {
              throw new RuntimeException("Serializing to a byte array threw an IOException " +
                      "(should never happen).", e);
          }
          return out.toByteArray();
      }