public void finish() throws IOException {
  if (done) {
    return;
  }
  def.finish();
  while (!def.finished()) {
    int byteCount=def.deflate(buf);
    out.write(buf,0,byteCount);
  }
  done=true;
}

public void finish ( ) throws IOException { if ( done ) { return ; } def . finish ( ) ; while ( ! def . finished ( ) ) { int byteCount = def . deflate ( buf ) ; out . write ( buf , 0 , byteCount ) ; } done = true ; }
writes any unwritten data to the underlying stream . does not close the stream .
