import java.io.*;
class CopyDocDemo{
public static void main(String[] args)throws IOException{
BufferedInputStream bis=new BufferedInputStream(
new FileInputStream("d:\\java.docx"));
BufferedOutputStream bos=new BufferedOutputStream(
new FileOutputStream("d:\\java_copy.docx"));
byte[] bys=new byte[1024] ;
int len=0;
while((len=bis.read(bys))!=-1){
bos.write(bys,0,len);
}
bis.close();
bis.close();
System.out.println("程序已经结束,去D盘看看");
}
} |
|