public class FileWriter extends OutputStreamWriter
FileOutputStream and initializes an
OutputStreamWriter to write to it.| Constructor and Description |
|---|
FileWriter(File file)
This method initializes a new
FileWriter object to write
to the specified File object. |
FileWriter(File file,
boolean append)
This method initializes a new
FileWriter object to write
to the specified File object. |
FileWriter(String name)
This method intializes a new
FileWriter object to
write to the
specified named file. |
FileWriter(String name,
boolean append)
This method intializes a new
FileWriter object to
write to the
specified named file. |
close, flush, getEncoding, writepublic FileWriter(File file) throws SecurityException, IOException
FileWriter object to write
to the specified File object.file - The File object to write to.SecurityException - If writing to this file is forbidden by the
SecurityManager.IOException - If any other error occursSecurityExceptionIOExceptionpublic FileWriter(File file, boolean append) throws IOException
FileWriter object to write
to the specified File object.file - The File object to write to.append - true to start adding data at the end of the
file, false otherwise.SecurityException - If writing to this file is forbidden by the
SecurityManager.IOException - If any other error occursIOExceptionpublic FileWriter(String name) throws IOException
FileWriter object to
write to the
specified named file.name - The name of the file to write toSecurityException - If writing to this file is forbidden by the
SecurityManager.IOException - If any other error occursIOExceptionpublic FileWriter(String name, boolean append) throws IOException
FileWriter object to
write to the
specified named file. This form of the constructor allows the caller
to determin whether data should be written starting at the beginning or
the end of the file.name - The name of the file to write toappend - true to start adding data at the end of the
file, false otherwise.SecurityException - If writing to this file is forbidden by the
SecurityManager.IOException - If any other error occursIOException