int min = 0;
int max = DCERPC_FAULT_CODES.length;
while (max >= min) {
int mid = (min + max) / 2;
if (errcode > DCERPC_FAULT_CODES[mid]) {
min = mid + 1;
} else if (errcode < DCERPC_FAULT_CODES[mid]) {
max = mid - 1;
} else {
return DCERPC_FAULT_MESSAGES[mid];
}
}
return "0x" + Hexdump.toHexString(errcode, 8);