How to create a Java non-blocking InputStream from a HttpsURLConnection?

前端 未结 5 1974
时光取名叫无心
时光取名叫无心 2021-01-02 15:44

Basically, I have a URL that streams xml updates from a chat room when new messages are posted. I\'d like to turn that URL into an InputStream and continue reading from it

5条回答
  •  猫巷女王i
    2021-01-02 16:33

    You can use the Java NIO library which provides non-blocking I/O capabilities. Take a look at this article for details and sample code: http://www.drdobbs.com/java/184406242.

提交回复
热议问题