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.
The FileWriter
is meant for writing streams of characters. For writing
streams of raw bytes, consider using a FileOutputStream
.
OutputStreamWriter
, FileOutputStream
, Charset#defaultCharset()
Access | Constructor and Description |
---|---|
public | FileWriter(String
String The system-dependent filename. fileName)Constructs a |
public | FileWriter(String
String The system-dependent filename. fileName, boolean boolean if append)true , then data will be written
to the end of the file rather than the beginning.Constructs a |
public | FileWriter(File
the file)File to write.Constructs a |
public | FileWriter(File
the file, boolean File to writeif append)true , then bytes will be written
to the end of the file rather than the beginningConstructs a |
public | FileWriter(FileDescriptor
the fd)FileDescriptor to write.Constructs a |
public | FileWriter(String
the name of the file to write fileName, Charset the charset charset)Constructs a |
public | FileWriter(String
the name of the file to write fileName, Charset the charset charset, boolean a boolean. If append)true , the writer will write the data
to the end of the file rather than the beginning.Constructs a |
public | FileWriter(File
the file, Charset File to writethe charset charset)Constructs a |
public | FileWriter(File
the file, Charset File to writethe charset charset, boolean a boolean. If append)true , the writer will write the data
to the end of the file rather than the beginning.Constructs a |
FileWriter | back to summary |
---|---|
public FileWriter(String fileName) throws IOException Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(String fileName, boolean append) throws IOException Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(File file) throws IOException Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(File file, boolean append) throws IOException Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(FileDescriptor fd) Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(String fileName, Charset charset) throws IOException Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(String fileName, Charset charset, boolean append) throws IOException Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(File file, Charset charset) throws IOException Constructs a
|
FileWriter | back to summary |
---|---|
public FileWriter(File file, Charset charset, boolean append) throws IOException Constructs a
|