Here you can find the source of isCompressed(HttpURLConnection connection)
private static boolean isCompressed(HttpURLConnection connection)
//package com.java2s; //License from project: LGPL import java.net.HttpURLConnection; import java.util.List; import java.util.Map; public class Main { private static boolean isCompressed(HttpURLConnection connection) { for (Map.Entry<String, List<String>> entry : connection.getHeaderFields().entrySet()) { if ("Content-Encoding".equalsIgnoreCase(entry.getKey())) { return "gzip".equalsIgnoreCase(entry.getValue().get(0)); }// w ww . jav a 2 s.c o m } return false; } }