private void endImpl() { if (streamHandle != -1) { endImpl(streamHandle); inputBuffer = null; streamHandle = -1; } }
@Override protected void finalize() { try { if (guard != null) { guard.warnIfOpen(); } synchronized (this) { end(); // to allow overriding classes to clean up endImpl(); // in case those classes don't call super.end() } } finally { try { super.finalize(); } catch (Throwable t) { throw new AssertionError(t); } } }
/** * Frees all resources held onto by this deflating algorithm. Any unused input or output is * discarded. This method should be called explicitly in order to free native resources as soon as * possible. After {@code end()} is called, other methods will typically throw {@code * IllegalStateException}. */ public synchronized void end() { guard.close(); endImpl(); }