toUTF16

fun Char.toUTF16(byteOrder: ByteOrder): ByteArray

Encodes a Char to a ByteArray in UTF-16 using the given ByteOrder.

Return

the ByteArray representing the Char in UTF-16.

Parameters

byteOrder

the ByteOrder to use.


Encodes a String to a ByteArray using UTF-16.

Return

The encoded ByteArray

Parameters

byteOrder

the ByteOrder to use.