IO流入门-第八章-BufferedWriter

BufferedWriter基本用法和方法示例

import java.io.*;

public class BufferedWriterTest01
{
public static void main(String[] args) throws Exception
{
//创建带有缓冲区的字符输出流
//BufferedWriter bw = new BufferedWriter(new FileWriter("temp04")); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("temp04",true))); bw.write("hello");
bw.newLine(); //写入一个行分隔符
bw.write("java"); bw.flush(); bw.close();
}
}
上一篇:在ubuntu16.04中初次体验.net core 2.0


下一篇:oracle系列(三)表操作基础