db.addToBuffer(p);
		public Object next() {			Lock lock = db.getLock();			try {				try {					lock.acquire();				} catch (LockException e) {					return null;				}				Value nextVal = null;				if(gotoNextPosition()) {				    do {						DOMFilePageHeader ph = p.getPageHeader();						// next value larger than length of the current page?						if (offset >= ph.getDataLength()) {							// load next page in chain							final long nextPage = ph.getNextDataPage();							if (nextPage < 0) {								LOG.debug("bad link to next " + p.page.getPageInfo());								return null;							}							page = nextPage;							p = db.getCurrentPage(nextPage);							offset = 0;						}						lastOffset = offset;												// extract tid						lastTID = ByteConversion.byteToShort(p.data, offset);						offset += 2;						//	check if this is just a link to a relocated node						if(ItemId.isLink(lastTID)) {							// skip this							offset += 8;							continue;						}						// read data length						short l = ByteConversion.byteToShort(p.data, offset);						offset += 2;						if(ItemId.isRelocated(lastTID)) {							// found a relocated node. Skip the next 8 bytes							offset += 8;						}						if(l == DOMFile.OVERFLOW) {							final long op = ByteConversion.byteToLong(p.data, offset);							offset += 8;							final byte[] data = db.getOverflowValue(op);							nextVal = new Value(data);						} else {							nextVal = new Value(p.data, offset, l);							offset += l;						}						nextVal.setAddress(							StorageAddress.createPointer((int) page, ItemId.getId(lastTID))						);				    } while(nextVal == null);				}				return nextVal;			} catch (BTreeException e) {				LOG.warn(e);			} catch (IOException e) {				LOG.warn(e);			} finally {			    lock.release();			}			return null;		}