run method
Writes whole words: the bytes after the run are written over by the next write. Most runs are a key with its comma: 1 or 2 words, with no loop.
Implementation
@pragma('vm:prefer-inline')
// the room for every write below is made at the start of this method
@pragma('vm:unsafe:no-bounds-checks')
@override
void run(JsonRun run) {
Int64List words = run.words;
int count = words.length;
_reserve(count * 8);
ByteData data = _data;
int at = _length;
data.setInt64(at, words[0], Endian.little);
if (count > 1) {
data.setInt64(at + 8, words[1], Endian.little);
for (int i = 2; i < count; i++) {
data.setInt64(at + i * 8, words[i], Endian.little);
}
}
_length = at + run.length;
}