writeUtf8Simple method

void writeUtf8Simple(
  1. String value
)

Writes an UTF-8 string.

Validates that all runes take only a single byte in UTF-8. Throws ArgumentError if any rune is greater than 127.

Implementation

void writeUtf8Simple(String value) {
  final multiByteRuneIndex = _writeUtf8Simple(value);
  if (multiByteRuneIndex<0) {
    // All bytes were 0..127
    return;
  }
  throw new ArgumentError.value(value, "value", "encountered a multi-byte rune at $multiByteRuneIndex");
}