我用的是try{
FileInputStream in= new FileInputStream("c:/1.doc");
byte[] content=new byte[1024*100];
int i=in.read(content);
FileOutputStream fos = new FileOutputStream("c:/3.doc");
for(int j=0;j<i;j++){
fos.write(content[j]);
}
fos.close();
in.close(); FileInputStream in1= new FileInputStream("c:/2.doc");
byte[] content1 = new byte[1024*100];
int n = in1.read(content1);
fos = new FileOutputStream("c:/3.doc",true);
for(int m=0;m<n;m++){
fos.write(content1[m]);
}
fos.close();
}
catch(Exception e){
System.out.println("Exception is "+e);
}
FileInputStream in= new FileInputStream("c:/1.doc");
byte[] content=new byte[1024*100];
int i=in.read(content);
FileOutputStream fos = new FileOutputStream("c:/3.doc");
for(int j=0;j<i;j++){
fos.write(content[j]);
}
fos.close();
in.close(); FileInputStream in1= new FileInputStream("c:/2.doc");
byte[] content1 = new byte[1024*100];
int n = in1.read(content1);
fos = new FileOutputStream("c:/3.doc",true);
for(int m=0;m<n;m++){
fos.write(content1[m]);
}
fos.close();
}
catch(Exception e){
System.out.println("Exception is "+e);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货