转自:
Writer类是Java IO中所有Writer的基类
Writer的实现子类,包含BufferedWriter和PrintWriter
Writer类的构造函数
创建一个字符流writer,将同步 writer 自身 protected Writer() 创建一个字符流 writer,将同步给定的对象 protected Writer(Object lock)
Writer类的方法
Writer append(char c) 将指定字符添加到此 writer |
Writer append(CharSequence csq) 将指定字符序列添加到此 writer |
Writer append(CharSequence csq, int start, int end) 将指定字符序列的子序列添加到此 writer.Appendable |
abstract void close() 关闭此流,但要先刷新它 |
abstract void flush() 刷新该流的缓冲 |
void write(char[] cbuf) 写入字符数组 |
abstract void write(char[] cbuf, int off, int len) 写入字符数组的某一部分 |
void write(int c) 写入单个字符 |
void write(String str) 写 |