}
/** {@inheritDoc} */
public void output(OutputStream stream) throws IOException {
populateDictionary();
PDFStream helperStream = new PDFStream(trailerDictionary.getDictionary(), false) {
@Override
protected void setupFilterList() {
PDFFilterList filterList = getFilterList();
assert !filterList.isInitialized();
filterList.addDefaultFilters(document.getFilterMap(), getDefaultFilterName());
}
};
helperStream.setObjectNumber(objectNumber);
helperStream.setDocument(document);
ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream(byteArray);
addFreeEntryForObject0(data);
for (ObjectReference objectReference : objectReferences) {
assert objectReference != null;
objectReference.output(data);
}
new UncompressedObjectReference(startxref).output(data);
data.close();
helperStream.setData(byteArray.toByteArray());
PDFDocument.outputIndirectObject(helperStream, stream);
}