我用的是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);
}