copyUTF16IntoArray

fun String.copyUTF16IntoArray(array: ByteArray, offset: Int = 0, byteOrder: ByteOrder): ByteArray

Encodes a String using UTF-16 and copies it into a ByteArray at a given offset.

Return

The encoded ByteArray

Parameters

array

the ByteArray to copy the encoded data into.

offset

the offset at which to copy the encoded data.

byteOrder

the ByteOrder to use.