|
@@ -11,6 +11,7 @@ import com.fdkankan.model.proto.Visionmodeldata;
|
|
|
import com.fdkankan.model.proto.format.JsonFormat;
|
|
|
import com.google.protobuf.TextFormat;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.io.*;
|
|
|
import java.util.HashMap;
|
|
@@ -257,7 +258,7 @@ public class CreateObjUtil {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void convertTxtToDam(String srcpath,String despath)throws Exception{
|
|
|
+ public static void convertTxtToDam(String srcpath,String despath,Boolean gzip)throws Exception{
|
|
|
BigSceneProto.binary_mesh.Builder builder = BigSceneProto.binary_mesh.newBuilder();
|
|
|
InputStream inputStream = new FileInputStream(srcpath);
|
|
|
InputStreamReader reader = new InputStreamReader(inputStream, "ASCII");
|
|
@@ -275,11 +276,17 @@ public class CreateObjUtil {
|
|
|
bis.close();
|
|
|
bos.close();
|
|
|
|
|
|
- // gzip压缩
|
|
|
- FileUtil.writeBytes(ZipUtil.gzip(new File(despath)),despath + ".gzip");
|
|
|
+ if(!ObjectUtils.isEmpty(gzip) && gzip){
|
|
|
+ // gzip压缩
|
|
|
+ FileUtil.writeBytes(ZipUtil.gzip(new File(despath)),despath + ".gzip");
|
|
|
|
|
|
- // 重命名
|
|
|
- FileUtil.rename(new File(despath + ".gzip"), despath, true);
|
|
|
+ // 重命名
|
|
|
+ FileUtil.rename(new File(despath + ".gzip"), despath, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void convertTxtToDam(String srcpath,String despath)throws Exception{
|
|
|
+ convertTxtToDam(srcpath,despath,true);
|
|
|
}
|
|
|
|
|
|
public static void convertVisionmodeldataToTxt(String srcpath,String despath)throws Exception
|