We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7c7006 commit 171a4c6Copy full SHA for 171a4c6
test/micro/org/openjdk/bench/java/util/zip/InflaterInputStreams.java
@@ -108,7 +108,10 @@ public void beforeIteration() throws IOException {
108
@Benchmark
109
public void inflaterInputStreamRead() throws IOException {
110
deflated.reset();
111
- InflaterInputStream iis = new InflaterInputStream(deflated);
112
- while (iis.read(inflated, 0, inflated.length) != -1);
+ // We close the InflaterInputStream to release underlying native resources of the Inflater.
+ // The "deflated" ByteArrayInputStream remains unaffected.
113
+ try (InflaterInputStream iis = new InflaterInputStream(deflated)) {
114
+ while (iis.read(inflated, 0, inflated.length) != -1);
115
+ }
116
}
117
0 commit comments