FileWriterNameFileWriterSynopsis
DescriptionThe FileWriter class represents a character stream that writes data to a file. It is a subclass of OutputStreamWriter that uses a default buffer size (8192 bytes) to write bytes to a file and the default character encoding scheme to convert characters to bytes. If you need to specify the character encoding or the buffer size, wrap an OutputStreamWriter around a FileOutputStream. The file can be specified using a FileDescriptor, a File object, or a String that represents a pathname. All of the constructors can throw a SecurityException if the application does not have permission to write to the specified file. FileWriter provides a low-level interface for writing character data to a file. You should think about wrapping a FileWriter with a BufferedWriter to increase writing efficiency. If you need to write binary data to a file, you should use a FileOutputStream wrapped by a DataOutputStream or a PrintStream instead. Class Summary
public class java.io.FileWriter extends java.io.OutputStreamWriter { // Constructors public FileWriter(String fileName); public FileWriter(String fileName, boolean append); public FileWriter(File file); public FileWriter(FileDescriptor fd); } ConstructorsFileWriterpublic FileWriter(String fileName) throws IOException
public FileWriter(String fileName, boolean append) throws IOException
public FileWriter(File file) throws IOException
public FileWriter(FileDescriptor fdObj)
Inherited Methods
See AlsoBufferedWriter, DataOutputStream, File, FileDescriptor, FileNotFoundException, FileOutputStream, IOException, NullPointerException, OutputStreamWriter, SecurityException, Writer |
|