flush method
Drains any buffered bytes downstream (CORELIB_PLAN ยง5.1). Call once at the end of a message.
On a sink-less encoder (Encoder.overBuffer) there is nowhere to drain to: the message is already in the caller's buffer, where written returns it, and this is a no-op that leaves it there.
Implementation
void flush() => _drain();