@Override
    public ByteBuffer serialize(StructLikeMap<T> data) {
      Map<String, T> stringKeyMap = Maps.newHashMap();
      for (StructLike pd : data.keySet()) {
        String pathLike = spec.partitionToPath(pd);
        stringKeyMap.put(pathLike, data.get(pd));
      }
      String value;
      try {
        value = new ObjectMapper().writeValueAsString(stringKeyMap);
      } catch (JsonProcessingException e) {
        throw new UncheckedIOException(e);
      }
      return ByteBuffer.wrap(value.getBytes());
    }
A serializer to serialize and deserialize data between ByteBuffer and Type T.

@param <T> - the class type of the data
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/StatisticsFileUtil.java