InputStream in=new FileInputStream("fromfilename");
OutputStream out=new FileOutputStream("tofilename");
byte[] buff=new byte[2048]//经过我测试,2048性能相对不错
int len;
while((len=in.read(buff))>-1){
out.write(buff,0,len);
}
in.flush();
in.close();
out.close();