FileDocCategorySizeDatePackage
FileWriter.javaAPI DocAndroid 1.5 API3767Wed May 06 22:41:04 BST 2009java.io

FileWriter

public class FileWriter extends OutputStreamWriter
A specialized {@link Writer} that writes to a file in the file system. All write requests made by calling methods in this class are directly forwarded to the equivalent function of the underlying operating system. Since this may induce some performance penalty, in particular if many small write requests are made, a FileWriter is often wrapped by a BufferedWriter.
see
BufferedWriter
see
FileReader
since
Android 1.0

Fields Summary
Constructors Summary
public FileWriter(File file)
Creates a FileWriter using the File {@code file}.

param
file the non-null File to write bytes to.
throws
IOException if {@code file} cannot be opened for writing.
since
Android 1.0

        super(new FileOutputStream(file));
    
public FileWriter(File file, boolean append)
Creates a FileWriter using the File {@code file}. The parameter {@code append} determines whether or not the file is opened and appended to or just opened and overwritten.

param
file the non-null File to write bytes to.
param
append indicates whether or not to append to an existing file.
throws
IOException if the {@code file} cannot be opened for writing.
since
Android 1.0

        super(new FileOutputStream(file, append));
    
public FileWriter(FileDescriptor fd)
Creates a FileWriter using the existing FileDescriptor {@code fd}.

param
fd the non-null FileDescriptor to write bytes to.
since
Android 1.0

        super(new FileOutputStream(fd));
    
public FileWriter(String filename)
Creates a FileWriter using the platform dependent {@code filename}.

param
filename the non-null name of the file to write bytes to.
throws
IOException if the file cannot be opened for writing.
since
Android 1.0

        super(new FileOutputStream(new File(filename)));
    
public FileWriter(String filename, boolean append)
Creates a FileWriter using the platform dependent {@code filename}. The parameter {@code append} determines whether or not the file is opened and appended to or just opened and overwritten.

param
filename the non-null name of the file to write bytes to.
param
append indicates whether or not to append to an existing file.
throws
IOException if the {@code file} cannot be opened for writing.
since
Android 1.0

        super(new FileOutputStream(filename, append));
    
Methods Summary