Flushes pending writes.
Future<void> close({bool flush = true}) async { if (flush) await this.flush(); }