code: private static void writeObjectByReflection(final Kryo kryo, final Output output, final Object obj) {
          val className = obj.getClass().getCanonicalName();
          kryo.writeObject(output, className);
          kryo.writeObject(output, obj);
      }
docs: Write object by reflection.
  
  @param kryo   the kryo
  @param output the output
  @param obj    the obj