*/
public void saveIncremental( FileInputStream input, OutputStream output ) throws IOException, COSVisitorException
{
//update the count in case any pages have been added behind the scenes.
getDocumentCatalog().getPages().updateCount();
COSWriter writer = null;
try
{
// Sometimes the original file will be missing a newline at the end
// In order to avoid having %%EOF the first object on the same line
// as the %%EOF, we put a newline here. If there's already one at
// the end of the file, an extra one won't hurt. PDFBOX-1051
output.write("\r\n".getBytes());
writer = new COSWriter( output, input );
writer.write( this );
writer.close();
}
finally
{
if( writer != null )
{
writer.close();
}
}
}