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

前端 未结 5 1965
时光取名叫无心
时光取名叫无心 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条回答
  •  遥遥无期
    2021-01-02 16:32

    There is no HTTP/HTTPS implementation using Channels. There is no way to read the inputstream from a httpurlconnaction in a non-blocking way. You either have to use a third party lib or implement http over SocketChannel yourself.

提交回复
热议问题