try {
java.util.zip.ZipFile zipFile = new java.util.zip.ZipFile(System.getProperty("user.dir")+"/files/test.zip");
Enumeration enumer = zipFile.entries();
while(enumer.hasMoreElements()){
ZipEntry zipEntry = (ZipEntry) enumer.nextElement();
if(zipEntry.isDirectory()){
System.err.println(new String(zipEntry.getName().getBytes("ISO-8859-1"),"GB2312"));
new File("G:/zipTest/"+zipEntry.getName()).mkdirs();
continue;
}
BufferedInputStream bip = new BufferedInputStream(zipFile.getInputStream(zipEntry));
File file = new File("G:/zipTest/"+zipEntry.getName());
File parentFile = file.getParentFile();
if(parentFile != null && (!parentFile.exists())){
parentFile.mkdirs();
}
FileOutputStream fop = new FileOutputStream(file);
BufferedOutputStream bop = new BufferedOutputStream(fop,1024);
int len = 0;
byte [] buf = new byte [1024];
while((len = bip.read(buf, 0,1024)) != -1){
bop.write(buf, 0, len);
}
bop.flush();
bop.close();
bip.close();
}
zipFile.close();
} catch (Exception e) {
e.printStackTrace();
}
zip解壓縮
相關文章
- 壓縮解壓命令(tar, zip)
- zip壓縮和解壓縮
- 利用Java實現zip壓縮/解壓縮 (轉)Java
- CentOS中zip壓縮和unzip解壓縮命令詳解CentOS
- Ashampoo ZIP Pro 4,解壓縮
- ZipArchive解壓縮zip檔案Hive
- Linux下zip壓縮和unzip解壓縮命令全解Linux
- CentOS7中zip壓縮和unzip解壓縮命令詳解CentOS
- 簡單的zip壓縮和解壓縮
- zip壓縮檔案處理方案(Zip4j壓縮和解壓)
- JAVA基礎:利用Java實現zip壓縮解壓縮(轉)Java
- Java使用Zip壓縮Java
- WinZip Pro 9 for Mac 專業zip壓縮解壓工具Mac
- The Unarchiver - Unzip RAR ZIP Mac - mac解壓縮工具HiveMac
- 使用org.apache.tools.zip實現zip壓縮和解壓Apache
- 使用jar與zip壓縮解壓檔案的區別JAR
- node ~ zip壓縮 && 檔案加密加密
- p7zip 解壓超過 4G壓縮包
- rar壓縮解壓工具:RAR Extractor - ZIP Unarchiver中文啟用版Hive
- Java實現檔案壓縮與解壓[zip格式,gzip格式]Java
- ZIP壓縮演算法詳細分析及解壓例項解釋演算法
- Golang 學習筆記(五)- archive/zip 實現壓縮及解壓Golang筆記Hive
- ZIP壓縮演算法原理分析及解壓例項程式碼演算法
- java 把檔案壓縮成 zipJava
- java 生成 zip格式 壓縮檔案Java
- linux命令系列-zip(壓縮打包)Linux
- 使用java API進行zip遞迴壓縮資料夾以及解壓JavaAPI遞迴
- 解壓縮軟體:iFastZip - Extract RAR&ZIP&7Z for MacASTMac
- Ubuntu解壓縮zip,tar,tar.gz,tar.bz2Ubuntu
- Windows的壓縮資料夾(zip/cab)Windows
- Android總結之Gzip/Zip壓縮Android
- Mac 解密 zip 解壓Mac解密
- 壓縮檔案格式rar和zip有什麼區別 zip和rar哪個是無失真壓縮
- 禁止Mac Safari下載zip檔案後自動解壓縮Mac
- 壓縮檔案格式rar和zip有什麼區別 壓縮檔案格式rar和zip哪個好
- linux壓縮解壓縮Linux
- java 壓縮包 遍歷解壓 zip 和 7z 指定格式檔案Java
- Zip 壓縮、解壓技術在 HTML5 瀏覽器中的應用HTML瀏覽器