close method

void close({
  1. int? length,
})

Flushes, optionally truncates to the codec's returned length, and closes.

Implementation

void close({int? length}) {
  try {
    if (length != null) {
      _file.truncateSync(length);
    }
    _file.flushSync();
  } finally {
    _file.closeSync();
  }
}