ZlibѹËõËã·¨ÔÚjavaÉϵÄÓ¦ÓÃ
JAVAʵÏÖ
¡¡¡¡ÔÚJDKÖУ¬ÔÚjava.util.zip°üÖÐÒѾÄÚÖÃÁËZLIBµÄʵÏÖ£¬Ê¾Àý´úÂëÈçÏ£º
1//½âѹ
2 public String decompressData(String encdata) {
3 try {
4 ByteArrayOutputStream bos = new ByteArrayOutputStream();
5 InflaterOutputStream zos = new InflaterOutputStream(bos);
6 zos.write(convertfromBase64(encdata));
7 zos.close();
8 return new String(bos.toByteArray());
9 } catch (Exception ex) {
10 ex.printStackTrace();
11 return "UNZIP_ERR";
12 }
13 }
14
15 //ѹËõ
16 public String compressData(String data) {
17 try {
18 ByteArrayOutputStream bos = new ByteArrayOutputStream();
19 DeflaterOutputStream zos = new DeflaterOutputStream(bos);
20 zos.write(data.getBytes());
21 zos.close();
22 return new String(convertToBase64(bos.toByteArray()));
23 } catch (Exception ex) {
24 ex.printStackTrace();
25 return "ZIP_ERR";
26 }
27 }
²»¹ýÎÒAndroidÀïÃæInflaterOutputStreamºÃÏñ²»Ö§³Ö ÎÒ»¹Ã»Ïëµ½ÈçºÎÔÚandroidÀïʵÏÖ
Ïà¹ØÎĵµ£º
ÏÖÔÚÓÃlinuxµÄÅóÓÑÔ½À´Ô½¶àÁË£¬Ç°¼¸Ìì¾ÍÓÐÁ½¸öÅóÓÑÎÊÎÒlinuxÏÂÔõôÅäÖÃjava»·¾³£¬ÎÒÏ뻹ÓкܶàÅóÓÑÏëÁ˽âѧϰÕâ·½ÃæµÄ¶«Î÷£¬¾Íдһ¸öÍêȫһµãµÄlinux java»·¾³ÅäÖðɣ¬Ï£Íû¶Ô´ó¼ÒÓаïÖú¡£
Ò». ÏÂÔØjdk5.0 for linux
¡¡¡¡µ½sunµÄÖ÷Ò³ http://java.sun.com/j2se/1.5.0/download.jsp ÏÂÔØjdk°²×°Îļþjdk-1_5_0_05-linux-i586 ......
ÔÚ²©¿ÍÔ°ÉÏ¿´µ½ÕâÑùµÄ´úÂ룬°ÑËü´ò°ü³ÉÒ»¸öexeÎļþ
public class Test
{
public static void main(String[] args)
{
String str="C:\\Program Files\\Tencent\\TM2009\\Bin\\TM.exe";
......
// µ¼Èë£É£Ï¿âÀà
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
// µ¼Èë¡¡£Ð£Ï£É¿âÀà
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi ......
Õâ¶Îʱ¼äÔÚ×¢²áÓòÃû£¬ÔÛÆð²½Íí£¬ºÃÓõÄÓòÃû¶¼¸ø±ðÈË×¢²áÁË¡£
ÏëÕÒ¸öλÊýÉÙµÄ.comÓòÃû£¬¿ÉÊÇ·¢Ïִ󲿷ֶ¼×¢²áÁË£¬Ò²¾ÍÊÇ˵£¬ÎÒµã»÷µÄ¶à´Î²éѯ¶¼ÊÇÀË·Ñ¿¨Â·ÀÎҿɲ»Ïë¼õ·Ê£©
ÓÚÊÇ»¨Á˵ãʱ¼ä£¬ÓÃjavaдÁ˸ö¸ù¾ÝÖ¸¶¨Î»Êý²éѯËùÓпÉÓõÄ.comÓòÃûµÄС³ÌÐò¡£ÌṩԴÂëÏÂÔØ¡£
ÎÒÀûÓõÄÊÇwhoisÕâ¸öÓòÃû²éÑ¯ÍøÕ¾È¡µÃÊý¾Ý£¬ÔÚ²âÊÔµ ......
POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream(cfname));
HSSFWorkbook wb = new HSSFWorkbook(fs);
......