初始化代码

This commit is contained in:
黄志军
2021-10-26 19:20:52 +08:00
commit 61f66423e5
84 changed files with 28268 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package util.zip;
import org.springframework.util.StopWatch;
import java.io.File;
class PrintTool {
static void calculateTimeAndLength(File[] files, StopWatch stopWatch, File resultFile){
//计算一下文件的大小
double length = 0.0000;
for (File file : files) {
length = length + file.length();
}
System.out.println(
"文件大小:" + length / 1024.00 / 1024.00 + "M,转换时间:" + stopWatch.getTotalTimeMillis() / 1000.000 + " s," + "压缩后文件大小:" + resultFile
.length() / 1024.00 / 1024.00 + " M");
}
}