packStr method

void packStr(
  1. String s
)

Packs a string as a ushort length prefix followed by its UTF-8 bytes (<H%ds).

Implementation

void packStr(String s) {
  final List<int> bytes = utf8.encode(s);
  packUShort(bytes.length);
  _builder.add(bytes);
}