package file_filter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopyFile {
public static void copy(String srcFile,String dstFile){
FileInputStream fin = null;
FileOutputStream fout = null;
try{
fin = new FileInputStream(srcFile);
fout = new FileOutputStream(dstFile);
int read = -1;
while((read = fin.read()) >= 0){
fout.write(read);
}
} catch(FileNotFoundException e){
e.printStackTrace();
} catch(IOException e){
e.printStackTrace();
} finally{
try{
if(fin != null) fin.close();
if(fin != null) fout.close();
} catch(Exception e){}
}
}
public static void main(String[] args){
copy("C://1.txt","C://2.txt");
}
}