1. 程式人生 > >JAVA高階視訊_IO輸入與輸出

JAVA高階視訊_IO輸入與輸出

import java.io.*;
class CopyTextByBuf
{
public static void main(String[]args)
{
BufferedReader bufr = null;
BufferedWriter bufw = null;
try
{
bufr = new BufferedReader(new FileReader("BufferedWriterDemo.java"));
bufw = new BufferedWriter(new FileWriter("bufWriter_Copy.text"));
String line = null;
while((line=bufr.readLine())!=null)
{
bufw.write(line);
bufw.newLine();
bufw.flush();
}
}catch (IOException e)
{
throw new RuntimeException("