generate

fun generate(uc: Int, len: Int, dst: CharBuffer): Int

Generates one or two UTF-16 characters to represent the given UCS-4 character.

Return

Either a positive count of the number of UTF-16 characters written to the destination buffer, or -1, in which case error() will return a descriptive result object

Parameters

uc

The UCS-4 character

len

The number of input bytes from which the UCS-4 value was constructed (used when creating result objects)

dst

The destination buffer, to which one or two UTF-16 characters will be written


fun generate(uc: Int, len: Int, da: CharArray, dp: Int, dl: Int): Int

Generates one or two UTF-16 characters to represent the given UCS-4 character.

Return

Either a positive count of the number of UTF-16 characters written to the destination buffer, or -1, in which case error() will return a descriptive result object

Parameters

uc

The UCS-4 character

len

The number of input bytes from which the UCS-4 value was constructed (used when creating result objects)

da

The destination array, to which one or two UTF-16 characters will be written

dp

The destination position

dl

The destination limit