public void append(Collection<WaveletDeltaRecord> deltas) throws PersistenceException {
checkIsOpen();
try {
file.seek(file.length());
WaveletDeltaRecord lastDelta = null;
for (WaveletDeltaRecord delta : deltas) {
index.addDelta(delta.getTransformedDelta().getAppliedAtVersion(),
delta.getTransformedDelta().size(),
file.getFilePointer());
writeDelta(delta);
lastDelta = delta;
}
// fsync() before returning.
file.getChannel().force(true);
endVersion = lastDelta.getTransformedDelta().getResultingVersion();
} catch (IOException e) {
throw new PersistenceException(e);
}
}