Posted on 2007-07-31 14:16
尚爱军 阅读(219)
评论(0) 编辑 收藏
import java.io.*;
public class FileCopy {
public static void main(String[] args) {
int temp = 0;
try {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("d:\\111042010449.wmv"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("d:\\1110.wmv"));
while((temp=bis.read()) !=-1) {
bos.write(temp);
}
bis.close();
bos.flush();
bos.close();
}catch (IOException e) {
e.printStackTrace();
System.out.println("文件读取错误!!!");
}
System.out.println("文件拷贝成功!!!");
}
}