if( pbo instanceof COSObject )
{
// We have to check if the expected values are there or not PDFBOX-385
if (po.get(po.size()-1) instanceof COSInteger)
{
COSInteger genNumber = (COSInteger)po.remove( po.size() -1 );
if (po.get(po.size()-1) instanceof COSInteger)
{
COSInteger number = (COSInteger)po.remove( po.size() -1 );
COSObjectKey key = new COSObjectKey(number.intValue(), genNumber.intValue());
pbo = document.getObjectFromPool(key);
}
else
{
// the object reference is somehow wrong