public void finish() throws IOException {
  closeEntry();
  cdOffset=new ZipLong(written);
  for (int i=0; i < entries.size(); i++) {
    writeCentralFileHeader(entries.elementAt(i));
  }
  cdLength=new ZipLong(written - cdOffset.getValue());
  writeCentralDirectoryEnd();
  offsets.clear();
  entries.removeAllElements();
}

public void finish ( ) throws IOException { closeEntry ( ) ; cdOffset = new ZipLong ( written ) ; for ( int i = 0 ; i < entries . size ( ) ; i ++ ) { writeCentralFileHeader ( entries . elementAt ( i ) ) ; } cdLength = new ZipLong ( written - cdOffset . getValue ( ) ) ; writeCentralDirectoryEnd ( ) ; offsets . clear ( ) ; entries . removeAllElements ( ) ; }
finishs writing the contents and closes this as well as the underlying stream .
