/** * Truncates the file to zero length. * * @throws IOException if an I/O error occurs. */ public void clear() throws IOException { int maxNrRegions = INITIAL_NR_REGIONS; mappedByteBuffers = new MappedByteBuffer[maxNrRegions]; srcByteBuffers = new ByteBuffer[maxNrRegions]; intBuffers = new IntBuffer[maxNrRegions]; longBuffers = new LongBuffer[maxNrRegions]; nrMappedRegions = 0; /* if (System.getProperty("os.name").startsWith("Win")) { // This is needed for Windows. System.gc(); try { Thread.sleep(100); } catch (InterruptedException ie) { } System.runFinalization(); } */ super.clear(); }