java读取URL 返回XML 文件1M 浏览器直接打开5秒钟 使用下面代码 却要50多秒 求大神指导
String url="####################";
URLConnection uc=null;
InputStream in=null;
InputStreamReader rd=null;
List<MatchInfo> mList1 = new ArrayList<MatchInfo>();
try {
Date stratDate = new Date();
uc = new URL(url).openConnection();
uc.setConnectTimeout(10000);
uc.setDoOutput(true);
in = new BufferedInputStream(uc.getInputStream());
rd = new InputStreamReader(in, "UTF-8");
java.io.BufferedReader br = new java.io.BufferedReader(rd);
String tempbf;
StringBuffer temp=new StringBuffer();
while ((tempbf = br.readLine()) != null) {
temp.append(tempbf);
temp.append("\r\n");
}
String content = HttpClientSSL.getContent1(url);
System.out.println("抓取 结束" + " 耗时----"
+ (stratDate.getTime() - new Date().getTime()) / 1000.0);