---
title: "zip解压"
author: "tomp110"
date: "2009-02-11T14:17:26Z"
tags: []
slug: "zip"
draft: false
lastmod: "2009-02-11T14:17:26Z"
id: 326736
url: "https://tomp110.iteye.com/blog/326736"
---

private   static   void   extZipFileList(String   zipFileName,   String   extPlace)   {   
  try   {   
    
  ZipInputStream   in   =   new   ZipInputStream(new   FileInputStream(   
  zipFileName));   
    
  ZipEntry   entry   =   null;   
    
  while   ((entry   =   in.getNextEntry())   !=   null)   {   
    
  String   entryName   =   entry.getName();   
    
  if   (entry.isDirectory())   {   
  File   file   =   new   File(extPlace   +   entryName);   
  file.mkdirs();   
  System.out.println("创建文件夹:"   +   entryName);   
  }   else   {   
    
  FileOutputStream   os   =   new   FileOutputStream(extPlace   
  +   entryName);   
    
  //   Transfer   bytes   from   the   ZIP   file   to   the   output   file   
  byte   buf   =   new   byte;   
    
  int   len;   
  while   ((len   =   in.read(buf))   >   0)   {   
  os.write(buf,   0,   len);   
  }   
  os.close();   
  in.closeEntry();   
    
  }