How to kill a BufferedInputStream .read() call

前端 未结 3 1605
既然无缘
既然无缘 2021-01-20 21:52

I\'m working on writing a program to download very large files (~2GB) from a server. I\'ve written the program to be able to resume partially finished downloads,

In

3条回答
  •  旧时难觅i
    2021-01-20 22:33

    See http://thushw.blogspot.com/2010/10/java-urlconnection-provides-no-fail.html for code to handle this situation

    Edited: actually, setting a Socket timeout (in milliseconds) using setSoTimeout (as suggested in the link comment from Joop Eggen) is probably better.

提交回复
热议问题