修复ZipUtil中zlib和unZlib调用后资源未释放问题(issue#3976@Github)

This commit is contained in:
Looly
2025-06-20 10:43:09 +08:00
parent 46249c257f
commit 5919837386
2 changed files with 4 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
# 🚀Changelog
-------------------------------------------------------------------------------------------------------------
# 5.8.39(2025-06-14)
# 5.8.39(2025-06-20)
### 🐣新特性
* 【ai 】 增加SSE流式返回函数参数callback增加超时时间配置豆包、grok新增文生图接口豆包生成视频支持使用model,新增HutoolAI平台
@@ -21,6 +21,7 @@
* 【core 】 修复`ThreadUtil`中中断异常处理丢失中断信息的问题解决ConcurrencyTester资源未释放的问题pr#1358@Gitee
* 【core 】 修复`TEL_400_800`正则规则太窄问题issue#3967@Github
* 【core 】 修复`ClassUti`isNormalClass判断未排除String问题issue#3965@Github
* 【core 】 修复`ZipUtil`中zlib和unZlib调用后资源未释放问题issue#3976@Github
-------------------------------------------------------------------------------------------------------------
# 5.8.38(2025-05-13)

View File

@@ -926,7 +926,7 @@ public class ZipUtil {
*/
public static byte[] zlib(InputStream in, int level, int length) {
final ByteArrayOutputStream out = new ByteArrayOutputStream(length);
Deflate.of(in, out, false).deflater(level);
Deflate.of(in, out, false).deflater(level).close();
return out.toByteArray();
}
@@ -974,7 +974,7 @@ public class ZipUtil {
*/
public static byte[] unZlib(InputStream in, int length) {
final ByteArrayOutputStream out = new ByteArrayOutputStream(length);
Deflate.of(in, out, false).inflater();
Deflate.of(in, out, false).inflater().close();
return out.toByteArray();
}