try {
byte[] keyBuff = new byte[ObjectId.NUM_BYTES];
DatabaseEntry key = new DatabaseEntry(keyBuff);
RevObject found = null;
while (sortedIds.hasNext() && found == null) {
ObjectId id = sortedIds.next();
id.getRawValue(keyBuff);
key.setData(keyBuff);
DatabaseEntry data = new DatabaseEntry();
// lookup data for the next key
OperationStatus status;
status = cursor.getSearchKey(key, data, LockMode.READ_UNCOMMITTED);
if (SUCCESS.equals(status)) {
InputStream rawData;
rawData = new LZFInputStream(new ByteArrayInputStream(data.getData()));
found = reader.read(id, rawData);
listener.found(found.getId(), data.getSize());
} else {
listener.notFound(id);
}
}
if (found == null) {