What InputStream type should be used to handle URLConnection streams that have HTTP Content-Encoding set to deflate?
For a Content-Encoding of gzip or zip I use a GZIPInputStream, no problem.
For a Content-Encoding of "deflate" I have tried using InflaterInputStream and DeflaterInputStream but I get
java.util.zip.ZipException: unknown
compression method
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
My understanding is that "deflate" encoding refers to Zlib compression, and according to the docs this should be handled by InflaterInputStream.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…