Reading a web page in Java IOException Premature EOF

后端 未结 5 636
离开以前
离开以前 2020-12-16 19:10

I am frequently getting a \'Premature EOF\' Exception when reading a web page.

The following is the StackTrace

java.io.IOException: Premature EOF
            


        
5条回答
  •  不知归路
    2020-12-16 19:16

    You can use APACHE commons io FileUtils.copyURLToFile method

    http://commons.apache.org/io/api-release/org/apache/commons/io/FileUtils.html#copyURLToFile%28java.net.URL,%20java.io.File,%20int,%20int%29

提交回复
热议问题