FileInputStream fis = new FileInputStream(“D:/test.txt”);
FileOutputStream fos = new FileOutputStream("C:/test.txt");
FileChannel fc1 = fis.getChannel();
FileChannel fc2 = fos.getChannel();
fc2.transferFrom(fc1, 0, fc1.size());
fc1.close();
fc2.close();
fis.close();
fos.close();
FileOutputStream fos = new FileOutputStream("C:/test.txt");
FileChannel fc1 = fis.getChannel();
FileChannel fc2 = fos.getChannel();
fc2.transferFrom(fc1, 0, fc1.size());
fc1.close();
fc2.close();
fis.close();
fos.close();