setLength

fun setLength(newLength: Int)(source)

Changes the content length, growing the buffer if needed.

Shortening discards the suffix without shrinking capacity. Extending fills every newly exposed position with the NUL code unit (\u0000), including after shortening.

Parameters

newLength

desired number of UTF-16 code units.

Throws