}
//
Patch patch = GeneratePatchInspector.delta(lastFullContent.second(), contentByteArray);
int patchSerializedLength = patch.serializedLength();
final boolean writeComplete = preferCompleteOverPatch(patchSerializedLength, contentByteArray.length);
DataSerializer.DataSource dataSource = writeComplete ? new ByteArrayDataSource(contentByteArray) : patch.new PatchDataSource();
//
doAdd(newRev, p1, p2, linkRevision, writeComplete ? lastEntryIndex+1 : lastEntryBase, contentByteArray.length, dataSource);
lastFullContent = new Pair<Integer, byte[]>(lastEntryIndex, contentByteArray);
return new Pair<Integer, Nodeid>(lastEntryIndex, lastEntryRevision);
}