相似功能实现,经验共享,有待改进;
//JDK1.3.1
String getURLString(String web){
String allString="";
URL url=new URL(web);
try{
InputStream is=url.openStream() ;
while(true){
byte[] bytes=new byte[1024];
int temp=is.read(bytes);
if(temp==-1){
break;
}
if(temp==1024){
allString+=new String(bytes);
}else{
byte[] tempbytes=new byte[temp];
for(int i=0;i<temp;i++){
tempbytes[i]=bytes[i];
}
allString+=new String(tempbytes);
}
}
is.close() ;
}catch(Exception e){
out.println(e.toString() ) ;
}
return allString;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货