Skip to content

Commit 2135f7f

Browse files
committed
Merge pull request #14001 from izeye:gh-13935
* pr/14001: Invoke Inflater.end() in ZipInflaterInputStream.close()
2 parents b6dddcc + af2db82 commit 2135f7f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/ZipInflaterInputStream.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,12 +30,19 @@
3030
*/
3131
class ZipInflaterInputStream extends InflaterInputStream {
3232

33+
private final Inflater inflater;
34+
3335
private boolean extraBytesWritten;
3436

3537
private int available;
3638

3739
ZipInflaterInputStream(InputStream inputStream, int size) {
38-
super(inputStream, new Inflater(true), getInflaterBufferSize(size));
40+
this(inputStream, new Inflater(true), size);
41+
}
42+
43+
private ZipInflaterInputStream(InputStream inputStream, Inflater inflater, int size) {
44+
super(inputStream, inflater, getInflaterBufferSize(size));
45+
this.inflater = inflater;
3946
this.available = size;
4047
}
4148

@@ -56,6 +63,12 @@ public int read(byte[] b, int off, int len) throws IOException {
5663
return result;
5764
}
5865

66+
@Override
67+
public void close() throws IOException {
68+
super.close();
69+
this.inflater.end();
70+
}
71+
5972
@Override
6073
protected void fill() throws IOException {
6174
try {

0 commit comments

Comments
 (0)