java.io
Class FileWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.OutputStreamWriter
-
- java.io.FileWriter
-
- All Implemented Interfaces:
- Closeable, Flushable, Appendable, AutoCloseable
public class FileWriter extends OutputStreamWriter
Convenience class for writing character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are acceptable. To specify these values yourself, construct an OutputStreamWriter on a FileOutputStream.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.
FileWriter
is meant for writing streams of characters. For writing streams of raw bytes, consider using aFileOutputStream
.- Since:
- JDK1.1
- See Also:
OutputStreamWriter
,FileOutputStream
-
-
Constructor Summary
Constructors Constructor and Description FileWriter(File file)
Constructs a FileWriter object given a File object.FileWriter(File file, boolean append)
Constructs a FileWriter object given a File object.FileWriter(FileDescriptor fd)
Constructs a FileWriter object associated with a file descriptor.FileWriter(String fileName)
Constructs a FileWriter object given a file name.FileWriter(String fileName, boolean append)
Constructs a FileWriter object given a file name with a boolean indicating whether or not to append the data written.
-
Method Summary
-
Methods inherited from class java.io.OutputStreamWriter
close, flush, getEncoding, write, write, write
-
-
'Dev. 자바 > API 및 이론' 카테고리의 다른 글
[JAVA API] java.lang.Thread (0) | 2012.09.03 |
---|---|
[JAVA API] java.util.HashSet<E> (0) | 2012.09.01 |
[JAVA API] java.io.FileReader (0) | 2012.08.08 |
[JAVA API] java.io.FileOutputStream (0) | 2012.08.08 |
[JAVA API] java.io.FileInputStream (0) | 2012.08.08 |