while ((upperBound = readEntity(bdi, false, false)) != END_OF_LIST) {
byte start;
do {
// see it is a reference first
bdi.mark();
start = bdi.readByte();
bdi.goBackOne();
if (start == HEADER_INDEX_REFERENCE_INTEGER || start == HEADER_INDEX_REFERENCE_LONG) {
// it is a reference, continue
reference = readVarLong(bdi);