mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复ZipUtil
中zlib和unZlib调用后资源未释放问题(issue#3976@Github)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user