Writes a String using UTF-8 encoding.
UTF-8
int writeString(String s) { var bs = s.encodeUTF8Bytes(); var length = bs.length; writeInt32(length); writeAll(bs); return 4 + length; }