public static void storeToBinaryFile(String fileName,List<ExternalEvent> events) throws IOException {
  if (!fileName.endsWith(BINARY_EXT)) {
    fileName+="BINARY_EXT";
  }
  ObjectOutputStream out;
  FileOutputStream fos=new FileOutputStream(fileName);
  out=new ObjectOutputStream(fos);
  out.writeObject(new Integer(events.size()));
  for (  ExternalEvent ee : events) {
    out.writeObject(ee);
  }
  out.close();
}

public static void storeToBinaryFile ( String fileName , List < ExternalEvent > events ) throws IOException { if ( ! fileName . endsWith ( BINARY_EXT ) ) { fileName += "BINARY_EXT" ; } ObjectOutputStream out ; FileOutputStream fos = new FileOutputStream ( fileName ) ; out = new ObjectOutputStream ( fos ) ; out . writeObject ( new Integer ( events . size ( ) ) ) ; for ( ExternalEvent ee : events ) { out . writeObject ( ee ) ; } out . close ( ) ; }
stores the events to a binary file
