java.io.ZipInputStrean

    //解压zip
    //java.io.ZipInputStream
    ZipInputStream  zip =new ZipInputStream(new FileInputStream("D:/abc.zip"));
    ZipEntry entry =null;
    while((entry=zip.getNextEntry())!=null){
      System.out.println(entry.getName());
      if(entry.isDirectory()){
         java.io.File file = new java.io.File("D:/qq/"+entry.getName());
         file.mkdir();
      }else{
        FileOutputStream fileOutputStream2 =new FileOutputStream("D:/qq/"+entry.getName());
        byte by[] =new byte[1024];
        while((zip.read(by))!=-1){
          fileOutputStream2.write(by,0,by.length);
        }
        fileOutputStream2.close();
      }
    }

你可能感兴趣的:(java,qq)