mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix #I2B0S1
This commit is contained in:
parent
82662f03a5
commit
7d25da459f
@ -3,12 +3,13 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.5.6 (2020-12-28)
|
||||
# 5.5.6 (2020-12-29)
|
||||
|
||||
### 新特性
|
||||
* 【core 】 手机号工具类 座机正则表达式统一管理(pr#243@Gitee)
|
||||
|
||||
### Bug修复
|
||||
* 【core 】 修复ZipUtil.unzip从流解压关闭问题(issue#I2B0S1@Gitee)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -2914,7 +2914,20 @@ public class FileUtil extends PathUtil {
|
||||
* @throws IORuntimeException IO异常
|
||||
*/
|
||||
public static File writeFromStream(InputStream in, File dest) throws IORuntimeException {
|
||||
return FileWriter.create(dest).writeFromStream(in);
|
||||
return writeFromStream(in, dest, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将流的内容写入文件
|
||||
*
|
||||
* @param dest 目标文件
|
||||
* @param in 输入流
|
||||
* @return dest
|
||||
* @throws IORuntimeException IO异常
|
||||
* @since 5.5.6
|
||||
*/
|
||||
public static File writeFromStream(InputStream in, File dest, boolean isCloseIn) throws IORuntimeException {
|
||||
return FileWriter.create(dest).writeFromStream(in, isCloseIn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -644,7 +644,7 @@ public class ZipUtil {
|
||||
outItemFile.mkdirs();
|
||||
} else {
|
||||
// 文件
|
||||
FileUtil.writeFromStream(zipStream, outItemFile);
|
||||
FileUtil.writeFromStream(zipStream, outItemFile, false);
|
||||
}
|
||||
});
|
||||
return outFile;
|
||||
|
@ -119,7 +119,7 @@ public class StreamExtractor implements Extractor{
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
outItemFile.mkdirs();
|
||||
} else {
|
||||
FileUtil.writeFromStream(in, outItemFile);
|
||||
FileUtil.writeFromStream(in, outItemFile, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user