private boolean validateXrefOffsets(Map<COSObjectKey, Long> xrefOffset) throws IOException { if (xrefOffset == null) { return true; } for (Entry<COSObjectKey, Long> objectEntry : xrefOffset.entrySet()) { COSObjectKey objectKey = objectEntry.getKey(); Long objectOffset = objectEntry.getValue(); // a negative offset number represents an object number itself // see type 2 entry in xref stream if (objectOffset != null && objectOffset >= 0 && !checkObjectKey(objectKey, objectOffset)) { LOG.debug("Stop checking xref offsets as at least one (" + objectKey + ") couldn't be dereferenced"); return false; } } return true; }
private boolean validateXrefOffsets(Map<COSObjectKey, Long> xrefOffset) throws IOException { if (xrefOffset == null) { return true; } for (Entry<COSObjectKey, Long> objectEntry : xrefOffset.entrySet()) { COSObjectKey objectKey = objectEntry.getKey(); Long objectOffset = objectEntry.getValue(); // a negative offset number represents an object number itself // see type 2 entry in xref stream if (objectOffset != null && objectOffset >= 0 && !checkObjectKey(objectKey, objectOffset)) { LOG.debug("Stop checking xref offsets as at least one (" + objectKey + ") couldn't be dereferenced"); return false; } } return true; }
private boolean validateXrefOffsets(Map<COSObjectKey, Long> xrefOffset) throws IOException { if (xrefOffset == null) { return true; } for (Entry<COSObjectKey, Long> objectEntry : xrefOffset.entrySet()) { COSObjectKey objectKey = objectEntry.getKey(); Long objectOffset = objectEntry.getValue(); // a negative offset number represents a object number itself // see type 2 entry in xref stream if (objectOffset != null && objectOffset >= 0 && !checkObjectKey(objectKey, objectOffset)) { LOG.debug("Stop checking xref offsets as at least one (" + objectKey + ") couldn't be dereferenced"); return false; } } return true; }