short count = 0; short currentId, vlen; int dlen = page.getPageHeader().getDataLength(); for (int pos = 0; pos < dlen; count++) { currentId = ByteConversion.byteToShort(page.data, pos); buf.append(ItemId.getId(currentId) + " "); if (ItemId.isLink(currentId)) { pos += 10; } else { vlen = ByteConversion.byteToShort(page.data, pos + 2); if (ItemId.isRelocated(currentId)) { pos += vlen == OVERFLOW ? 20 : vlen + 12; } else pos += vlen == OVERFLOW ? 12 : vlen + 4; } } buf.append("; records in page: " + count); return buf.toString();
short count = 0; short currentId, vlen; int dlen = page.getPageHeader().getDataLength(); for (int pos = 0; pos < dlen; count++) { currentId = ByteConversion.byteToShort(page.data, pos); buf.append(ItemId.getId(currentId) + "[" + pos); if (ItemId.isLink(currentId)) { buf.append(':').append(10).append("] "); pos += 10; } else { vlen = ByteConversion.byteToShort(page.data, pos + 2); if(vlen < 0) { LOG.warn("Illegal length: " + vlen); return buf.toString(); } buf.append(':').append(vlen).append("] "); if (ItemId.isRelocated(currentId)) { pos += vlen == OVERFLOW ? 20 : vlen + 12; } else pos += vlen == OVERFLOW ? 12 : vlen + 4; } } buf.append("; records in page: " + count); return buf.toString();
    public String debugPageContents(DOMPage page) {    	StringBuffer buf = new StringBuffer();    	buf.append("Page " + page.getPageNum() + ": ");            short count = 0;            short currentId, vlen;            int dlen = page.getPageHeader().getDataLength();            for (int pos = 0; pos < dlen; count++) {                currentId = ByteConversion.byteToShort(page.data, pos);                buf.append(ItemId.getId(currentId) + " ");                if (ItemId.isLink(currentId)) {                        pos += 10;                } else {                    vlen = ByteConversion.byteToShort(page.data, pos + 2);                    if (ItemId.isRelocated(currentId)) {                        pos += vlen == OVERFLOW ? 20 : vlen + 12;                    } else                        pos += vlen == OVERFLOW ? 12 : vlen + 4;                }            }            buf.append("; records in page: " + count);            return buf.toString();    }