private static Method[] typeWrites(Class<?> clazz) {
      // find the methods that use a derived DataOutput instance as first parameter
      Method[] mwrites = clazz.getDeclaredMethods();
      List<Method> keepers = new ArrayList<>(mwrites.length);
      for (Method kwrite : mwrites) {
        Class<?>[] parms = kwrite.getParameterTypes();
        if ("write".equals(kwrite.getName())) {
          if (parms.length > 0 && DataOutput.class.isAssignableFrom(parms[0])) {
            kwrite.setAccessible(true);
            keepers.add(kwrite);
          }
        }
      }
      if (keepers.isEmpty()) {
        throw new ProxyException(clazz + ": serialization proxy can not find suitable write method");
      }
      // order the array of write methods by comparing their signatures
      Method[] kwrites = keepers.toArray(new Method[0]);
      Arrays.sort(kwrites, Type::compareSignatures);
      return kwrites;
    }
Determines the write method that take at least a DataOutput (as superclass) as first argument.
@param clazz the class whose write methods we seek
@return the methods
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/SerializationProxy.java