我尝试从网页阅读整个源代码,但我只收到一半或更少。我的代码有问题吗?
这是我写的代码:
public class ReadFromReuters {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
ReadFromReuters rfr = new ReadFromReuters();
try(BufferedReader br = new BufferedReader(new InputStreamReader(rfr.getConnection().getInputStream()))){
String str;
while((str = br.readLine()) != null){
System.out.println(str);
}
}catch(IOException ioe){}
}
public URLConnection getConnection() throws MalformedURLException, IOException{
URL reuters = new URL("http://www.quickflix.com.au/browse/play");
URLConnection conn = reuters.openConnection();
return conn;
}
public void splitBy(String str){
}
}