/*
* Main.java
*
* Created on 2007年11月6日, 上午9:13
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package proj1;
import java.io.*;
/**
*
* @author user
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
void copy(File src,File dest) throws FileNotFoundException,IOException
{
FileInputStream in=new FileInputStream(src);
FileOutputStream out=new FileOutputStream(dest);
byte[] b=new byte[1024];
int len;
while((len=in.read(b))>0)
{
out.write(b);
}
in.close();
out.close();
}
public static void main(String[] args) throws FileNotFoundException, IOException {
// TODO code application logic here
File f=new File("d://1.txt");
File f1=new File("d://2.txt");
Main m=new Main();
m.copy(f,f1);
}
}