intlen=-1;byte[]bt=newbyte[2048];//可以根据实际情况调整,建议使用1024,即每次读1KBwhile(len=(in.read(bt))!=-1){os.write(bt,0,len);//建议不要直接用os.write(bt)}os.flush();in.close();os.close();