- import java.io.*;
- class CopyTest
- {
- public static void main(String[] args)throws IOException
- {
- copyT();
- }
-
- public static void copyT()throws IOException
- {
- FileReader fr = new FileReader("D:\\guess_1.rar");
- FileWriter fw = new FileWriter("C:\\guess_1.rar");
- char[] buf = new char[1024];
-
- int len = 0;
- while((len=fr.read(buf))!=-1)
- {
-
- fw.write(new String(buf,0,len));
- fw.flush();
- }
- fw.close();
- fr.close();
- }
复制代码 |