writeSync static method

Result<(), IoError> writeSync(
  1. Path path,
  2. Uint8List bytes
)

Writes the entire contents of a file.

Implementation

static Result<(), IoError> writeSync(Path path, Uint8List bytes) {
  return Fs.ioGuardSync(() {
    final file = File(path.asString());
    file.writeAsBytesSync(bytes);
  }).map((_) => ());
}