Sfoglia il codice sorgente

压缩包: 压缩包形式批量下载文件-缓存大小

baichengfei 4 anni fa
parent
commit
3d27a6e76a

+ 1 - 1
src/main/java/com/common/workflow/service/util/File2Zip.java

@@ -38,7 +38,7 @@ public class File2Zip {
         response.setContentType("application/zip");// 定义输出类型
         FileInputStream fis = new FileInputStream(file);
         BufferedInputStream buff = new BufferedInputStream(fis);
-        byte[] b = new byte[4096];// 相当于我们的缓存
+        byte[] b = new byte[1024];// 相当于我们的缓存
         long k = 0;// 该值用于计算当前实际下载了多少字节
         OutputStream out = response.getOutputStream();// 从response对象中得到输出流,准备下载
         // 开始循环下载