Code example for HttpEntity

Methods: getContentgetContentEncoding

     * @param entity the entity whose content should be read 
     * @return the input stream to read from 
     * @throws IOException 
    public static InputStream getUngzippedContent(HttpEntity entity) throws IOException {
        InputStream responseStream = entity.getContent();
        if (responseStream == null)
            return responseStream;
        Header header = entity.getContentEncoding();
        if (header == null)
            return responseStream;
        String contentEncoding = header.getValue();
        if (contentEncoding == null)
            return responseStream;
        if (contentEncoding.contains(GZIP))
            responseStream = new GZIPInputStream(responseStream);
        return responseStream;
Connect your IDE to all the code out there  Get Codota for Java