writeAll method
Writes all bytes in src, looping over short writes.
Implementation
Future<void> writeAll(IoSlice src) async {
var offset = 0;
while (offset < src.length) {
final n = await writeFrom(
IoSlice(src.bytes, start: src.start + offset, end: src.end),
);
if (n <= 0) throw StateError('writeFrom made no progress');
offset += n;
}
}