public synchronized void writeNextSet(ChangeSet changeSet) { if (isCompletelyBroken) return; try { AbstractStorage.StorageDataOutput out = myStorage.writeStream(myStorage.createNextRecord(), true); try { changeSet.write(out); } finally { out.close(); } myStorage.setLastId(myLastId); myStorage.force(); } catch (IOException e) { handleError(e, null); } }
private int createRecord(int size) throws IOException { int r = myStorage.createNextRecord(); AbstractStorage.StorageDataOutput s = myStorage.writeStream(r, true); for (int i = 0; i < size; i++) { s.writeInt(r); } s.close(); return r; }