标签:bool idt com boolean images src inpu java div
Reader、Writer是所有字符流的超类。
Writer类方法
void write(String str)
void write(char[] cbuf, int off, int len);
void flush()
void close
OutputStreamWriter构造方法字符编码默认为系统编码,可以不写
FileWriter的append默认为false,可以不写。另一个构造(File file, boolean append)
Writer out = new FileWriter("E:/a.txt", true); OutputStream ops = new FileOutputStream("E:/a.txt", true); Writer out = new OutputStreamWriter(ops, "GBK"); // 默认系统编码,可以不写
Reader类
int read(char[] cbuf)
InputStreamReader与OutputStreamWriter类似
FileReader 与 FileWriter类似’
Reader in = new FileReader("E:/gbk.txt"); InputStream inStream = new FileInputStream("E/gbk.txt"); Reader in = new InputStreamReader(inStream, "gbk");
字符流Reader、Writer,字符转换流 OutputStreamWriter、InputStreamReader
标签:bool idt com boolean images src inpu java div
原文地址:http://www.cnblogs.com/YKang/p/7286642.html