Skip to content

Commit 21691f0

Browse files
committed
Merge branch '1.5.x' into 2.0.x
2 parents fbf3c48 + 2135f7f commit 21691f0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)