I am frequently getting a \'Premature EOF\' Exception when reading a web page.
The following is the StackTrace
java.io.IOException: Premature EOF
You can also try to set the buffer size to 1. This slightly helps and if you implement a try logic around it, then it should do the trick.