1
0
mirror of https://gitee.com/dromara/hutool.git synced 2025-04-05 17:37:59 +08:00

修复IoUtil.copyByNIO方法写出时没有flush的问题

This commit is contained in:
Looly 2022-10-27 18:51:00 +08:00
parent 2bafc6c8a8
commit 7b23328d3f
2 changed files with 5 additions and 2 deletions
CHANGELOG.md
hutool-core/src/main/java/cn/hutool/core/io

View File

@ -3,7 +3,7 @@
-------------------------------------------------------------------------------------------------------------
# 5.8.10.M1 (2022-10-24)
# 5.8.10.M1 (2022-10-27)
### 🐣新特性
* 【http 】 HttpResponse增加getFileNameFromDisposition方法pr#2676@Github
@ -13,6 +13,7 @@
* 【db 】 修复分页时order by截断问题issue#I5X6FM@Gitee
* 【core 】 修复Partition计算size除数为0报错问题pr#2677@Github
* 【core 】 由于对于ASCII的编码解码有缺陷且这种BCD实现并不规范因此BCD标记为弃用issue#I5XEC6@Gitee
* 【core 】 修复IoUtil.copyByNIO方法写出时没有flush的问题
-------------------------------------------------------------------------------------------------------------
# 5.8.9 (2022-10-22)

View File

@ -70,7 +70,9 @@ public class NioUtil {
* @since 5.7.8
*/
public static long copyByNIO(InputStream in, OutputStream out, int bufferSize, long count, StreamProgress streamProgress) throws IORuntimeException {
return copy(Channels.newChannel(in), Channels.newChannel(out), bufferSize, count, streamProgress);
final long copySize = copy(Channels.newChannel(in), Channels.newChannel(out), bufferSize, count, streamProgress);
IoUtil.flush(out);
return copySize;
}
/**