private static InputStream getInputStream(final URLConnection con) throws Exception {
		final InputStream in = con.getInputStream();
		final String encoding = con.getHeaderField("Content-Encoding");
		if (encoding != null) {
			if (encoding.equalsIgnoreCase("gzip")) {
				return new GZIPInputStream(in);
			} else if (encoding.equalsIgnoreCase("deflate")) {
				return new InflaterInputStream(in);
			}
		}
		return in;
	}