Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaʵÏÖzipÎļþѹËõ£¬½âѹ

Õ⼸Ìì¿´ÁËÍøÉÏһЩǰ±²µÄ´úÂ룬×Ô¼º¶ÔJavaʵÏÖzipÎļþµÄ½âѹ£¬Ñ¹ËõÓÐÒ»µãÀí½â£¬¹ÊдÏÂÁô×ÅÒÔºó²Î¿¼¡£
ΪÁË´¦ÀíÖÐÎÄÂÒÂëÎÊÌ⣬ʹÓÃant.jar°ü¡£
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
import org.apache.tools.zip.ZipOutputStream;
public class TestZip {
  
    private static int readByte;
    private static byte[] buf = new byte[1024];
    private static ZipOutputStream zipOut;
    private static BufferedInputStream fileIn;
    private static BufferedOutputStream fileOut;
   
    private static InputStream in;
   
    private static ZipFile zipFile;
   
    /**
     * ±éÀúÊý×飬µ÷ÓÃÎļþѹËõ·½·¨£¬Ñ¹ËõÎļþ
     *
     * @param list Îļþ¼¯ºÏ
     * @param zipName ѹËõÓеÄÎļþÃû
     * @return zipFile ѹËõºóµÄÎļþ
     * @throws IOException
     */
    public static File zip(List<File> list, String zipName) throws IOException {
        File zipFile = new File(zipName+".zip");
        zipOut = new ZipOutputStream(new BufferedOutputStream(
                new FileOutputStream(zipFile)));
        //½«×Ö·û¼¯É趨ΪGBK£¬Ö§³ÖÖÐÎÄ¡£
        zipOut.setEncoding("GBK");
     &n


Ïà¹ØÎĵµ£º

java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ


java¼¯ºÏ¿ò¼Üͼ¼°½éÉÜ
¼ò»¯Í¼£º
Javaƽ̨ÌṩÁËÒ»¸öȫеļ¯ºÏ¿ò¼Ü¡£“¼¯ºÏ¿ò¼Ü”Ö÷ÒªÓÉÒ»×éÓÃÀ´²Ù×÷¶ÔÏóµÄ½Ó¿Ú×é³É¡£²»Í¬½Ó¿ÚÃèÊöÒ»×鲻ͬÊý¾ÝÀàÐÍ¡£
Java 2¼¯ºÏ¿ò¼Üͼ
¼¯ºÏ½Ó¿Ú£º6¸ö½Ó¿Ú£¨¶ÌÐéÏß±íʾ£©£¬±íʾ²»Í¬¼¯ºÏÀàÐÍ£¬ÊǼ¯ºÏ¿ò¼ÜµÄ»ù´¡¡£
³éÏóÀࣺ5¸ö³éÏóÀࣨ³¤ÐéÏß±íʾ£©£¬¶Ô¼¯ºÏ½Ó¿ÚµÄ²¿·ÖʵÏÖ¡£ ......

JavaʼþÄ£ÐÍÓëAndroidʼþÄ£Ð͵ıȽÏ

JavaʼþÄ£ÐÍÓëAndroidʼþÄ£Ð͵ıȽÏ
±È½Ï½á¹û£ºAndroid½è¼øÁËJava2ÖеÄUIʼþ´¦Àí»úÖÆ£¬µ«ÊÇ£¬AndroidÓÖÌṩÁËÁíÒ»ÖÖʼþ處ÀíÆ÷£¨event handler£©£¬¶øÕâ¸ö·½Ê½ÊÇ·ñÓëjava1.0ʼþÄ£ÐÍÒ»ÑùÄØ£¬ÓдýÇóÖ¤¡£
JavaʼþÄ£ÐÍ£º
ÎÒÃÇ°ÑJDK1.0ʼþ´¦ÀíÄ£ÐͳÉΪJava1.0ʼþÄ£ÐÍ£¬¶ø´Ójdk1.1ºóµÄ°æ±¾Ê¼þ´¦ÀíÄ£ÐͳÆΪJava 2Ê ......

JavaÃæÊÔÌâ¼°´ð°¸£¨»ù´¡Ìâ122µÀ£©

JavaÃæÊÔÌâ¼°´ð°¸£¨»ù´¡Ìâ122µÀ£©
JAVAÏà¹Ø»ù´¡ÖªÊ¶
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ 
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£ ......

JAVAºìºÚÊ÷

JAVAºìºÚÊ÷
¸ÅÄÿ¸ö½Úµã¶¼´øÓÐÑÕÉ«ÊôÐԵĶþ²æ²éÕÒÊ÷£¬ÑÕÉ«»òºìÉ«»òºÚÉ«;
ÌØÐÔ£º
ÐÔÖÊ1. ½ÚµãÊǺìÉ«»òºÚÉ«¡£
¡¡¡¡ÐÔÖÊ2. ¸ùÊǺÚÉ«¡£
¡¡¡¡ÐÔÖÊ3. ÿ¸öºìÉ«½ÚµãµÄÁ½¸ö×ӽڵ㶼ÊǺÚÉ«¡£(´Óÿ¸öÒ¶×Óµ½¸ùµÄËùÓз¾¶Éϲ»ÄÜÓÐÁ½¸öÁ¬ÐøµÄºìÉ«½Úµã)
¡¡¡¡ÐÔÖÊ4. ´ÓÈÎÒ»½Úµãµ½Æäÿ¸öÒ¶×ÓµÄËùÓз¾¶¶¼°üº¬ÏàͬÊýÄ¿µÄºÚÉ«½Úµã¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ