CollationKey.ToByteArray Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Duplicates and returns the value of this CollationKey as a sequence of big-endian bytes terminated by a null.
[Android.Runtime.Register("toByteArray", "()[B", "", ApiSince=24)]
public byte[]? ToByteArray ();
[<Android.Runtime.Register("toByteArray", "()[B", "", ApiSince=24)>]
member this.ToByteArray : unit -> byte[]
Returns
CollationKey value in a sequence of big-endian byte bytes terminated by a null.
- Attributes
Remarks
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.");
Java documentation for android.icu.text.CollationKey.toByteArray()
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.