Convenience class for writing character files. The constructors of this
class assume that the default character encoding and the default byte-buffer
size are acceptable. To specify these values yourself, construct an
OutputStreamWriter on a FileOutputStream.
Whether or not a file is available or may be created depends upon the
underlying platform. Some platforms, in particular, allow a file to be
opened for writing by only one FileWriter (or other file-writing
object) at a time. In such situations the constructors in this class
will fail if the file involved is already open.
FileWriter is meant for writing streams of characters.
For writing streams of raw bytes, consider using a
FileOutputStream.
Constructs a FileWriter object given a File object. If the second
argument is true, then bytes will be written to the end
of the file rather than the beginning.
Parameters
file
a File object to write to
append
if true, then bytes will be written
to the end of the file rather than the beginning
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],["`FileWriter` writes character streams to files, using default encoding and buffer size unless specified otherwise via `OutputStreamWriter`. It offers constructors to create instances using a file name, a `File` object, or a `FileDescriptor`. You can specify appending data to an existing file. `FileWriter` extends `OutputStreamWriter` and inherits methods to close, flush, write characters, and get encoding. Platform restrictions may limit file access to one `FileWriter` at a time. Use `FileOutputStream` for raw byte streams.\n"]]