@Override
public int compare(byte[] b1, int o1, int l1, byte[] b2, int o2, int l2) {
byte type1 = b1[o1];
byte type2 = b2[o2];
if (isString(type1) && isString(type2)) {
return compareAsString(type1, b1, o1, type2, b2, o2);
} else if (isNumeric(type1) && isNumeric(type2)) {
return compareAsNumeric(type1, b1, o1, type2, b2, o2);
} else if (type1 == DSCODE.BOOLEAN && type2 == DSCODE.BOOLEAN) {
return compareAsBoolean(getBoolean(b1, o1), getBoolean(b2, o2));
} else if (type1 == DSCODE.CHARACTER && type2 == DSCODE.CHARACTER) {
return compareAsChar(getChar(b1, o1), getChar(b2, o2));
} else if (type1 == DSCODE.NULL || type2 == DSCODE.NULL) {
return type1 == type2 ? 0 : type1 == DSCODE.NULL ? 1 : -1;
}
return compareAsObject(b1, o1, l1, b2, o2, l2);
}