try {
//创建一个URL实例
URL url = new URL("http:XXXXXXXXXXXXXXXXXXX");
InputStream is=url.openStream();
InputStreamReader isr = new InputStreamReader(is, "utf-8");
byte[] bytes=new byte[20];
String str=new String(bytes,"utf-8");
BufferedReader br = new BufferedReader(isr);
String data = br.readLine();//读取数据
while (data != null) {//循环读取数据
System.out.println(data);//输出数据
data = br.readLine();
}
br.close();
isr.close();
is.close();
videoTitles1[0] = "Y";
}
catch(IOException e)
{
videoTitles1[0] = "错误";
}
牧羊人nacy