public ZipOutputStream(File file) throws IOException {
  super(null);
  try {
    raf=new RandomAccessFile(file,"rw");
    raf.setLength(0);
  }
 catch (  IOException e) {
    if (raf != null) {
      try {
        raf.close();
      }
 catch (      IOException inner) {
      }
      raf=null;
    }
    out=new FileOutputStream(file);
  }
}

public ZipOutputStream ( File file ) throws IOException { super ( null ) ; try { raf = new RandomAccessFile ( file , "rw" ) ; raf . setLength ( 0 ) ; } catch ( IOException e ) { if ( raf != null ) { try { raf . close ( ) ; } catch ( IOException inner ) { } raf = null ; } out = new FileOutputStream ( file ) ; } }
creates a new zip outputstream writing to a file . will use random access if possible .
