I am frequently getting a \'Premature EOF\' Exception when reading a web page.
The following is the StackTrace
java.io.IOException: Premature EOF
StringBuilder sb = new StringBuilder();
try{
URL url = new URL(address);
InputStream is = url.openStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader in = new BufferedReader(isr);
String str;
while((str = in.readLine()) != null){
sb.append(str);
sb.append("\n");
}
in.close();
isr.close();
is.close();
return sb.toString();
}catch(Exception e){
//OMG....
}