public static <T> T read(byte[] bytes, Class<T> clazz) {
    if (bytes == null) {
      return null;
    }
    try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
        ObjectInputStream inputStream = new ObjectInputStream(byteArrayInputStream)) {
      T t = clazz.cast(inputStream.readObject());
      return t;
    } catch (IOException | ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
Read class from Serialize byte array
amoro-format-mixed/amoro-mixed-trino/src/main/java/org/apache/amoro/trino/util/ObjectSerializerUtil.java