write method

void write(
  1. Object value,
  2. {Encoding encoding}
)
override

Writes data to the response.

Implementation

void write(value, {Encoding encoding}) {
  encoding ??= utf8;

  if (!isOpen && isBuffered) {
    throw closed();
  } else if (!isBuffered) {
    add(encoding.encode(value.toString()));
  } else {
    buffer.add(encoding.encode(value.toString()));
  }
}