mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix #I2B0S1
This commit is contained in:
@@ -3,12 +3,13 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.5.6 (2020-12-28)
|
# 5.5.6 (2020-12-29)
|
||||||
|
|
||||||
### 新特性
|
### 新特性
|
||||||
* 【core 】 手机号工具类 座机正则表达式统一管理(pr#243@Gitee)
|
* 【core 】 手机号工具类 座机正则表达式统一管理(pr#243@Gitee)
|
||||||
|
|
||||||
### Bug修复
|
### Bug修复
|
||||||
|
* 【core 】 修复ZipUtil.unzip从流解压关闭问题(issue#I2B0S1@Gitee)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -2914,7 +2914,20 @@ public class FileUtil extends PathUtil {
|
|||||||
* @throws IORuntimeException IO异常
|
* @throws IORuntimeException IO异常
|
||||||
*/
|
*/
|
||||||
public static File writeFromStream(InputStream in, File dest) throws IORuntimeException {
|
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();
|
outItemFile.mkdirs();
|
||||||
} else {
|
} else {
|
||||||
// 文件
|
// 文件
|
||||||
FileUtil.writeFromStream(zipStream, outItemFile);
|
FileUtil.writeFromStream(zipStream, outItemFile, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return outFile;
|
return outFile;
|
||||||
|
@@ -119,7 +119,7 @@ public class StreamExtractor implements Extractor{
|
|||||||
//noinspection ResultOfMethodCallIgnored
|
//noinspection ResultOfMethodCallIgnored
|
||||||
outItemFile.mkdirs();
|
outItemFile.mkdirs();
|
||||||
} else {
|
} else {
|
||||||
FileUtil.writeFromStream(in, outItemFile);
|
FileUtil.writeFromStream(in, outItemFile, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user