src/java.base/share/classes/java/util/zip/Inflater.java
Print this page
*** 23,35 ****
* 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
--- 23,32 ----
*** 116,139 ****
* 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();
! }
! });
}
/**
* Creates a new decompressor.
*/
--- 113,123 ----
* 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, () -> init(nowrap), Inflater::end);
}
/**
* Creates a new decompressor.
*/