writeAll method

void writeAll(
  1. Iterable objects,
  2. [String sep = ""]
)
inherited

Iterates over the given objects and writes them in sequence.

If separator is provided, a write with the separator is performed between any two elements of objects.

This operation is non-blocking. See flush or done for how to get any errors generated by this call.

Implementation

void writeAll(Iterable objects, [String sep = ""]) {
  Iterator iterator = objects.iterator;
  if (!iterator.moveNext()) return;
  if (sep.isEmpty) {
    do {
      _write(iterator.current);
    } while (iterator.moveNext());
  } else {
    _write(iterator.current);
    while (iterator.moveNext()) {
      _write(sep);
      _write(iterator.current);
    }
  }
}