Duplicates and returns the value of this CollationKey as a sequence of big-endian bytes terminated by a null.
If two CollationKeys can be legitimately compared, then one can compare the byte arrays of each to obtain the same result, e.g.
byte key1[] = collationkey1.toByteArray(); byte key2[] = collationkey2.toByteArray(); int key, targetkey; int i = 0; do { key = key1[i] & 0xFF; targetkey = key2[i] & 0xFF; if (key < targetkey) { System.out.println("String 1 is less than string 2"); return; } if (targetkey < key) { System.out.println("String 1 is more than string 2"); } i ++; } while (key != 0 && targetKey != 0); System.out.println("Strings are equal.");@return CollationKey value in a sequence of big-endian byte bytes terminated by a null. @stable ICU 2.8
|
|
|
|
|
|
|
|
|
|
|
|
|
|