/** * Optimization hook. */ public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { int thisLeftValue = readInt(b1, s1); int thatLeftValue = readInt(b2, s2); if (thisLeftValue == thatLeftValue) { long thisRightValue = readLong(b1, s1 + 4); long thatRightValue = readLong(b2, s2 + 4); return (thisRightValue < thatRightValue ? -1 : (thisRightValue == thatRightValue ? 0 : 1)); } return (thisLeftValue < thatLeftValue ? -1 : (thisLeftValue == thatLeftValue ? 0 : 1)); } }