openWrite abstract method
Creates a new independent IOSink for the file.
The IOSink must be closed when no longer used, to free system resources.
An IOSink for a file can be opened in two modes:
- FileMode.write: truncates the file to length zero.
- FileMode.append: sets the initial write position to the end of the file.
When writing strings through the returned IOSink the encoding
specified using encoding
will be used. The returned IOSink
has an encoding
property which can be changed after the
IOSink has been created.
The returned IOSink does not transform newline characters ("\n"
) to
the platform's conventional line ending (e.g. "\r\n"
on Windows). Write
a Platform.lineTerminator if a platform-specific line ending is needed.
Implementation
IOSink openWrite({FileMode mode = FileMode.write, Encoding encoding = utf8});