import java.io.*;
public class BufferWriterTest {
public static void main(String[] args) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("D:\\12345.txt",true)));
bw.write("嘿!");
bw.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
BufferedWriter用法举例
最新推荐文章于 2024-07-09 22:24:46 发布