The code below is for a Google App Engine project.
Why do I get a Stream Closed error without seeing any line returned?
I am definite that the page the URL points to is active.
URL url = new URL("http://banico.com.au");
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
resp.getWriter().println("START");
while ((line = reader.readLine()) != null)
{
reader.close();
}
resp.getWriter().println("END");
You should move the
reader.close();outside of the while statement.