Handling HTTP ContentEncoding “deflate”

后端 未结 2 1268
失恋的感觉
失恋的感觉 2020-12-11 15:29

What InputStream type should be used to handle URLConnection streams that have HTTP Content-Encoding set to deflate?

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 16:06

    Unfortunately, using the InflaterInputStream with an Inflater object did not always produce the correct decompression. I had to detect the headers and tell the Inflater where the offset to the payload was.

    http://thushw.blogspot.com/2014/05/decoding-html-pages-with-content.html

提交回复
热议问题