code: public void end() {
          synchronized (zsRef) {
              // Android-changed: added close guard
              guard.close();
              long addr = zsRef.address();
              zsRef.clear();
              if (addr != 0) {
                  end(addr);
                  buf = null;
              }
          }
      }
docs: Closes the compressor and discards any unprocessed input.
  This method should be called when the compressor is no longer
  being used, but will also be called automatically by the
  finalize() method. Once this method is called, the behavior
  of the Deflater object is undefined.