|
JavaTM Platform Standard Ed. 6 |
|||||||||
��һ���� ��һ���� | ��� ��� ������ | |||||||||
ժҪ�� Ƕ�� | �ֶ� | ���췽�� | ���� | ��ϸ��Ϣ�� �ֶ� | ���췽�� | ���� |
java.lang.Objectjava.io.Writer
java.io.OutputStreamWriter
java.io.FileWriter
public class FileWriter
����д���ַ��ļ��ı���ࡣ����Ĺ��췽���ٶ�Ĭ���ַ������Ĭ���ֽڻ�������С���ǿɽ��ܵġ�Ҫ�Լ�ָ����Щֵ���������� FileOutputStream �Ϲ���һ�� OutputStreamWriter��
�ļ��Ƿ���û��Ƿ���Ա�����ȡ���ڵײ�ƽ̨���ر���ijЩƽ̨һ��ֻ����һ�� FileWriter���������ļ�д������ļ�����д�롣����������£�������漰���ļ��Ѿ���������еĹ��췽����ʧ�ܡ�
FileWriter
����д���ַ�����Ҫд��ԭʼ�ֽ������뿼��ʹ�� FileOutputStream
��
OutputStreamWriter
,
FileOutputStream
�ֶ�ժҪ |
---|
���� java.io.Writer �̳е��ֶ� |
---|
lock |
���췽��ժҪ | |
---|---|
FileWriter(File file)
���ݸ����� File ������һ�� FileWriter ���� |
|
FileWriter(File file,
boolean append)
���ݸ����� File ������һ�� FileWriter ���� |
|
FileWriter(FileDescriptor fd)
������ij���ļ�������������� FileWriter ���� |
|
FileWriter(String fileName)
���ݸ������ļ�������һ�� FileWriter ���� |
|
FileWriter(String fileName,
boolean append)
���ݸ������ļ����Լ�ָʾ�Ƿ�д�����ݵ� boolean ֵ������ FileWriter ���� |
����ժҪ |
---|
���� java.io.OutputStreamWriter �̳еķ��� |
---|
close, flush, getEncoding, write, write, write |
���� java.io.Writer �̳еķ��� |
---|
append, append, append, write, write |
���� java.lang.Object �̳еķ��� |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
���췽����ϸ��Ϣ |
---|
public FileWriter(String fileName) throws IOException
fileName
- һ���ַ�������ʾ��ϵͳ�йص��ļ�����
IOException
- ���ָ���ļ����ڣ�������һ��Ŀ¼��������һ�������ļ������߸��ļ������ڣ��������������ֻ���Ϊ����ijЩԭ���������public FileWriter(String fileName, boolean append) throws IOException
fileName
- һ���ַ�������ʾ��ϵͳ�йص��ļ�����append
- һ�� boolean ֵ�����Ϊ true
��������д���ļ�ĩβ����������д���ļ���ʼ����
IOException
- ���ָ���ļ����ڣ�������һ��Ŀ¼��������һ�������ļ������߸��ļ������ڣ��������������ֻ���Ϊ����ijЩԭ���������public FileWriter(File file) throws IOException
file
- Ҫд�����ݵ� File ����
IOException
- ������ļ����ڣ�������һ��Ŀ¼��������һ�������ļ������߸��ļ������ڣ��������������ֻ���Ϊ����ijЩԭ���������public FileWriter(File file, boolean append) throws IOException
true
�����ֽ�д���ļ�ĩβ����������д���ļ���ʼ����
file
- Ҫд�����ݵ� File ����append
- ���Ϊ true
�����ֽ�д���ļ�ĩβ����������д���ļ���ʼ��
IOException
- ������ļ����ڣ�������һ��Ŀ¼��������һ�������ļ������߸��ļ������ڣ��������������ֻ���Ϊ����ijЩԭ���������public FileWriter(FileDescriptor fd)
fd
- Ҫд�����ݵ� FileDescriptor ����
|
JavaTM Platform Standard Ed. 6 |
|||||||||
��һ���� ��һ���� | ��� ��� ������ | |||||||||
ժҪ�� Ƕ�� | �ֶ� | ���췽�� | ���� | ��ϸ��Ϣ�� �ֶ� | ���췽�� | ���� |
��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������