writeString method

int writeString(
  1. String s
)

Writes a String using UTF-8 encoding.

Implementation

int writeString(String s) {
  var bs = s.encodeUTF8Bytes();
  var length = bs.length;
  writeInt32(length);
  writeAll(bs);
  return 4 + length;
}