writeAsBytesSync abstract method

void writeAsBytesSync(List<int> bytes, { FileMode mode: FileMode.WRITE, bool flush: false })

Synchronously write a list of bytes to a file.

Opens the file, writes the list of bytes to it and closes the file.

By default writeAsBytesSync creates the file for writing and truncates the file if it already exists. In order to append the bytes to an existing file, pass FileMode.APPEND as the optional mode parameter.

If the flush argument is set to true data written will be flushed to the file system before returning.

Throws a FileSystemException if the operation fails.

Source

void writeAsBytesSync(List<int> bytes,
    {FileMode mode: FileMode.WRITE, bool flush: false});

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-io/File/writeAsBytesSync.html