writeString method

void writeString(
  1. String value, {
  2. bool explicitLength = true,
})

Encode a string into the buffer. Strings are encoded with a varuint integer length written first followed by length number of utf8 encoded bytes.

Implementation

void writeString(String value, {bool explicitLength = true}) {
  var list = _utf8Encoder.convert(value);
  if (explicitLength) {
    writeVarUint(list.length);
  }
  write(list);
}