write method Null safety

void write(
  1. Uint8Buffer? buffer
)

Writes a sequence of bytes to the current buffer and advances the position within the buffer by the number of bytes written.

Implementation

void write(typed.Uint8Buffer? buffer) {
  if (this.buffer == null) {
    this.buffer = buffer;
  } else {
    this.buffer!.addAll(buffer!);
  }
  _position = length;
}