outW = null; resetWriter(); setWriteMode(CANCEL);
  public void writeBatch() throws IOException {              resetWriter();            if(getRetrieval() == INCREMENTAL)          throw new IOException("Batch and incremental saving cannot be mixed.");      if(getInstances() == null)          throw new IOException("No instances to save");      setRetrieval(BATCH);      if(retrieveFile() == null){        throw new IOException("No output to standard out for serialization.");      }      setWriteMode(WRITE);      ObjectOutputStream outW = 		  new ObjectOutputStream(		  new BufferedOutputStream(		  new FileOutputStream(retrieveFile())));      outW.writeObject(getInstances());      outW.flush();      outW.close();      setWriteMode(WAIT);  }