I want to read a xml file that is presnt on a remote location.I use the following code
URL url = new URL(myurl);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
String strOutput = "";
System.out.println("start now");
//my code hangs after priting start now
while ((inputLine = in.readLine()) != null) {
strOutput = strOutput + inputLine;
}
//contol doesnot reach here sometimes
in.close();
Is this a good way to read a remote file.What is the network is slow?Please suggest