public static MemoryDatabase readDatabaseFileFromDisk(File databaseFile, Transformer transformer) throws IOException { MemoryDatabase db = new MemoryDatabase(); DatabaseXmlSerializer dao = new DatabaseXmlSerializer(transformer); dao.load(db, databaseFile, DatabaseVersionType.DEFAULT); return db; }
public static void writeDatabaseFileToDisk( MemoryDatabase db, File writtenDatabaseFile, Transformer transformer) throws IOException { DatabaseXmlSerializer dao = new DatabaseXmlSerializer(transformer); dao.save(db.getDatabaseVersions(), writtenDatabaseFile); }