public class FileWriter extends AbstractTextWriter:
Text writer backed by one file.
Opening the writer truncates the target file.
import klyn.io
try writer = FileWriter("notes.txt"):
writer.writeLine("hello")| Modifier and Type | Member | Description |
|---|---|---|
| public | FileWriterFileWriter(filePath as Path): |
Creates a file text writer and truncates the target file. |
| public | FileWriterFileWriter(filePath as String): |
Creates a file text writer and truncates the target file. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | closeclose() as Void throws IOException: |
Closes the writer. |
| public override | writewrite(readonly value as String) as Void throws IOException: |
Writes raw text to the file. |