幸好java.util.zip包下提供了GZIPxxxx 可以直接调用, ContentEncoding为text/html或其他类似的文本直接打印出来就行 为gzip的话,需要再转化一下 上程序: String url = "http://health.sohu.com/yangshengtang/"; URL cumtURL = new URL( url); HttpURLConnection cumtConnection = (HttpURLConnection)cumtURL.openConnection(); cumtConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"); cumtConnection.setRequestProperty("Pragma", "no-cache"); cumtConnection.setRequestProperty("Proxy-Connection", "Keep-Alive"); cumtConnection.setRequestProperty("Host", "health.sohu.com"); //Cookie Hm_lvt_9f14aaa038bbba8b12ec2a4a3e51d254=1287650788640; BAIDUID=F25ABEDD87D60C8104D0CF4D75A71979:FG=1; bdime=0; BD_UTK_DVT=1; USERID=fdb673a39972591f66d93243 cumtConnection.setRequestProperty("Cookie", "YYID=C52798160DB2F2EB9A5C522772777A83; SUV=0812111111371033; vjuids=3f340bb23.11ed3e18865.0.7e372d1208008; vjlast=1231915420,1231915420,30.1292830395.10; IPLOC=CN6101"); cumtConnection.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); cumtConnection.setRequestProperty("Accept-Language", "zh-cn,zh;q=0.5"); cumtConnection.setRequestProperty("Pragma", "no-cache"); cumtConnection.setRequestProperty("Accept-Charset", "GB2312,utf-8;q=0.7,*;q=0.7"); cumtConnection.setRequestProperty("Accept-Encoding", "gzip,deflate"); System.out.println(cumtConnection.getContentEncoding()); // InputStream urlStream = cumtConnection.getInputStream(); InputStream urlStream = new GZIPInputStream(cumtConnection.getInputStream()); BufferedReader reader = new BufferedReader(new InputStreamReader(urlStream,"gb2312")); String line = ""; while((line = reader.readLine()) != null) { System.out.println(line); } reader.close(); urlStream.close();