src/java.base/share/classes/java/util/zip/Inflater.java
Print this page
@@ -23,13 +23,10 @@
* questions.
*/
package java.util.zip;
-import java.util.function.LongConsumer;
-import java.util.function.LongSupplier;
-
/**
* This class provides support for general purpose decompression using the
* popular ZLIB compression library. The ZLIB compression library was
* initially developed as part of the PNG graphics standard and is not
* protected by patents. It is fully described in the specifications at
@@ -116,24 +113,11 @@
* library in order to support certain optimizations.
*
* @param nowrap if true then support GZIP compatible compression
*/
public Inflater(boolean nowrap) {
- this.zsRef = ZStreamRef.get(this,
- // Desugared for startup purposes.
- new LongSupplier() {
- @Override
- public long getAsLong() {
- return init(nowrap);
- }
- },
- new LongConsumer() {
- @Override
- public void accept(long value) {
- end();
- }
- });
+ this.zsRef = ZStreamRef.get(this, () -> init(nowrap), Inflater::end);
}
/**
* Creates a new decompressor.
*/