writeStringUTF16 method

void writeStringUTF16(
  1. String text, [
  2. int? maxLength,
  3. int byteOffset = 0
])

Writes a UTF-16 text into a fixed-size maxLength-byte buffer field at address + byteOffset. Truncates if too long; otherwise NUL-terminates and zero-pads the remainder.

Implementation

void writeStringUTF16(String text, [int? maxLength, int byteOffset = 0])
  => offsetBy(byteOffset).cast<RInt16>().writeString(text, maxLength);