}
return low;
}
public DbResult derefByKey(String key) {
Bytes cmpKey = new CompoundBytes(DbServiceUtil.HEADER_BYTE_MAPOPEN,
new CompoundBytes(DbServiceUtil.sencodeMapKey(key),
DbServiceUtil.HEADER_BYTE_COLON));
int keyLen = cmpKey.getLength();
int idx = binarySearch(terms, cmpKey, numTerms);
Bytes[] subTerms = new Bytes[numTerms-idx]; // at most this many elements
int subIdx = 0;
for(;idx<numTerms;idx++) {
Bytes curTerm = terms[idx];
if (cmpKey.isPrefixOf(curTerm)) {
subTerms[subIdx++] = curTerm.subBytes(keyLen, curTerm.getLength()-keyLen);
} else {
break;
}
}
if (subIdx == 0) return null; // as opposed to a DbResult representing null