public static void serializeObject(OutputStream out, Object o) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(out);
        oos.writeObject(o);
    }
Utility class to create instances from class objects and checking failure reasons.

<p>Copied from Flink project.</p>
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/util/InstantiationUtil.java