written property
The bytes written into the active buffer since it was installed — the whole message for a sink-less encoder (Encoder.overBuffer) that had room for it, and whatever has not been flushed yet otherwise.
A view over the caller's buffer (no copy), valid until the next write
or buffer installation. It starts at the installation's offset, so the
framing-header room a caller reserved is not part of it.
Implementation
Uint8List get written => Uint8List.sublistView(_buf, _flushStart, _pos);