|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Writer
java.io.OutputStreamWriter
java.io.FileWriter
public class FileWriter
This is a convenience class for writing to files. It creates an
FileOutputStream and initializes an
OutputStreamWriter to write to it.
| Field Summary |
|---|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
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(FileDescriptor fd)
This method initializes a new FileWriter object to write
to the specified FileDescriptor 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. |
|
| Method Summary |
|---|
| Methods inherited from class java.io.OutputStreamWriter |
|---|
close, flush, getEncoding, write, write, write |
| Methods inherited from class java.io.Writer |
|---|
append, append, append, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public 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 occurs
public 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 occurs
public FileWriter(FileDescriptor fd)
throws SecurityException
FileWriter object to write
to the specified FileDescriptor object.
fd - The FileDescriptor object to write to
SecurityException - If writing to this file is forbidden by the
SecurityManager.
public FileWriter(String name)
throws IOException
FileWriter object to
write to the
specified named file.
name - The name of the file to write to
SecurityException - If writing to this file is forbidden by the
SecurityManager.
IOException - If any other error occurs
public 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 determine 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 occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||