addUTF16String method Null safety

void addUTF16String(
  1. String val
)

Add a UTF16 string, note Dart natively encodes strings as UTF16

Implementation

void addUTF16String(String val) {
  for (final codeunit in val.codeUnits) {
    if (codeunit <= 255 && codeunit >= 0) {
      _payload!.add(codeunit);
    } else {
      addHalf(codeunit);
    }
  }
}