}
}
}
boolean elision = false;
for (int index = 0; index < records.length; index++) {
final RecordInfo r = records[index];
String mark = " ";
boolean selected = all | index < contextLines || index >= records.length - contextLines;
if (foundPointerRecord >= 0) {
selected |= (index >= foundPointerRecord - contextLines)
&& (index <= foundPointerRecord + contextLines);
if (index == foundPointerRecord) {
mark = "*";
}
}
if (selected) {
final String keyString;
final String valueString;
if (r.getKeyState() != null) {
r.getKeyState().copyTo(key);
keyString = Util.abridge(key.toString(), maxKeyDisplayLength);
} else {
keyString = "*error*";
}
if (isDataPage() && r.getValueState() != null) {
r.getValueState().copyTo(value);
valueString = Util.abridge(value.toString(), maxValueDisplayLength);
} else {
valueString = "*error*";
}
if (elision) {
sb.append(String.format("\n ..."));
elision = false;
}
if (isDataPage()) {
r.getValueState().copyTo(value);
sb.append(String.format("\n%s %5d: db=%3d ebc=%3d tb=%,5d [%,d]%s=[%,d]%s", mark,
r.getKbOffset(), r.getDb(), r.getEbc(), r.getTbOffset(), r.getKLength(), keyString,
r.getValueState().getEncodedBytes().length, valueString));
} else {
sb.append(String.format("\n%s %5d: db=%3d ebc=%3d tb=%,5d [%,d]%s->%,d", mark,
r.getKbOffset(), r.getDb(), r.getEbc(), r.getTbOffset(), r.getKLength(), keyString,
r.getPointerValue()));
}
if (r.getError() != null) {
sb.append(String.format(" !! %s", r.getError()));
}
} else {
elision = true;
}