import java.io.*; /** * Data Copy Class */ public class CopyData{ /** * Constructer of this. * * @param org_file input file name. * @param dst_file input file name. */ public CopyData(String org_file, String dst_file){ try{ DataInputStream in = new DataInputStream(new FileInputStream(org_file)); DataOutputStream out= new DataOutputStream(new FileOutputStream(dst_file)); int b= in.read(); while(b!=-1){ out.write(b); b= in.read(); } in.close(); out.close(); }catch(IOException e){ e.printStackTrace(); } } /** * main */ public static void main(String[] args){ if(args.length!=2){ System.err.println("usage : java CopyData "); }else{ new CopyData(args[0], args[1]); } } }