import java.io.*; public class CopyTest{ public static void main(String[] args) throws Exception{ String src = args[0]; String dest = args[1]; FileInputStream fis = new FileInputStream(src); FileOutputStream fos = new FileOutputStream(dest); int read = fis.read(); while(read!= -1){ fos.write(read); read = fis.read(); } fos.flush(); fos.close(); } } //可以自定义源文件和目标文件