How to read compressed HTML page with Content-Encoding : gzip

前端 未结 3 2050
心在旅途
心在旅途 2021-01-05 04:56

I request a web page that sends a Content-Encoding: gzip header, but got stuck how to read it..

My code:

    try {
        URLConnec         


        
3条回答
  •  遥遥无期
    2021-01-05 05:46

    There is a class for this: GZIPInputStream. It is an InputStream and so is very transparent to use.

提交回复
热议问题