/** * Creates a new ZIP OutputStream writing to a File. Will use * random access if possible. * @param file the file to zip to * @throws IOException on error */ public ZipArchiveOutputStream(java.io.File file) //throws IOException { java.io.OutputStream o = null; java.io.RandomAccessFile _raf = null; try { _raf = new java.io.RandomAccessFile(file, "rw"); _raf.setLength(0); } catch (java.io.IOException) { if (_raf != null) { try { _raf.close(); } catch (java.io.IOException) { // ignore } _raf = null; } o = new java.io.FileOutputStream(file); } outJ = o; raf = _raf; }