// 2. Body update (modified indirect objects insertion).
XRefEntry xrefStreamEntry;
{
// 2.1. Content indirect objects.
IndirectObjects indirectObjects = file.getIndirectObjects();
// Create the xref stream indirect object!
/*
NOTE: Incremental xref table comprises multiple sections each one composed by multiple subsections;
this update adds a new section.
*/
/*
NOTE: This xref stream indirect object is purposely temporary (i.e. not registered into the file's
indirect objects collection).
*/
XRefStream xrefStream;
PdfIndirectObject xrefStreamIndirectObject = new PdfIndirectObject(
file,
xrefStream = new XRefStream(file),
xrefStreamEntry = new XRefEntry(indirectObjects.size(), 0, 0, XRefEntry.UsageEnum.InUse)
);
XRefEntry prevFreeEntry = null;
for(PdfIndirectObject indirectObject : indirectObjects.getModifiedObjects().values())
{
prevFreeEntry = addXRefEntry(
indirectObject.getXrefEntry(),
indirectObject,
xrefStream,