package cn.itcast_06;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Copy_01 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader("D:\\copy1\\txt.txt"));
BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\copy2\\txt.txt"));
char[] str = new char[5];
int len = 0;
while ((len = br.read(str, 0, len)) != -1) {
bw.write(str, 0, len);
}
br.close();
bw.close();
}
}
麻烦帮忙看一下 |