public static void demo1(){
String srcPath = "D:/";
String dest = "E:/";
String name = "a.txt";
//1、建立关联
File srcFile = new File(srcPath,name);
File destFile = new File(dest,name);
//2、选择流
InputStream is = null;
OutputStream os = null;
try {
//3、传输
is = new BufferedInputStream(new FileInputStream(srcFile));
os = new BufferedOutputStream(new FileOutputStream(destFile));