package com.qf.a.test;
import java.io.*;
//5、编写一个程序,将d:\java目录下的a.txt文件复制到d:\jad目录下。
public class Demo1 {
public static void main(String[] args) throws IOException {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(new File("D:/java/a.txt")));
BufferedOutputStream bof = new BufferedOutputStream(new FileOutputStream(new File("D:/java/jad/sb.txt")));
byte[] buf = new byte[1024];
int length;
while ((length=bis.read(buf))!=-1) {
bof.write(buf,0,length);
}
bof.close();
bis.close();
}
}