public void proxyWrite(T proxy, ObjectOutput out) {
      final Object[] arguments = SerializationProxy.swapExtraArguments(null);
      try {
        final Object[] writeArgs = makeArgs(out, arguments);
        final Method write = findBest(writes, writeArgs);
        write.invoke(proxy, writeArgs);
      } catch (InvocationTargetException xinvoke) {
        Throwable xtarget = xinvoke.getTargetException();
        throw ProxyException.convert(xtarget != null ? xtarget : xinvoke);
      } catch (IllegalAccessException | IllegalArgumentException xany) {
        throw ProxyException.convert(xany);
      } finally {
        SerializationProxy.swapExtraArguments(arguments);
      }
    }
Writes a proxified instance through an output calling one mandatory method write(DataOutput).
@param proxy the proxy
@param out the out
@throws ProxyException if any error occurs
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/SerializationProxy.java