Xiajijian
2026-03-10 f1eefdbe63b64afab32502785e9c46ffd35fc718
ard-route/src/main/java/com/ard/route/util/ToolUtils.java
@@ -1,10 +1,11 @@
package com.ard.route.util;
import com.ard.inspection.domain.ArdPointCloud;
import com.ard.route.domain.djuav.UavRouteReq;
import java.io.*;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
 * 工具类
@@ -86,6 +87,9 @@
    // 对象序列化为字节数组
    public static byte[] serialize(Object obj) throws IOException {
        if (obj == null) {
            return null;
        }
        try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
             ObjectOutputStream oos = new ObjectOutputStream(baos)) {
            oos.writeObject(obj);
@@ -101,6 +105,13 @@
        }
    }
    public static List<ArdPointCloud> deserializeLs(byte[] data) throws IOException, ClassNotFoundException {
        try (ByteArrayInputStream bais = new ByteArrayInputStream(data);
             ObjectInputStream ois = new ObjectInputStream(bais)) {
            return (List<ArdPointCloud>) ois.readObject();
        }
    }
    /**
     * 截取字符串
     * 参数: https://xxx.xxx.xxx.xxx:xxx/kmz/2025/11/08/文件名_20251108152249A001.kmz