Sunday, January 13, 2013

Read zip file using Java

1:05 AM

This is a simple code to Read a zip file ........





import 
java.io.FileInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class Main {

  public static void main(String[] argsthrows Exception {
    FileInputStream fis = new FileInputStream("C:/MyZip.zip");
    ZipInputStream zis = new ZipInputStream(fis);
    ZipEntry ze;
    while ((ze = zis.getNextEntry()) != null) {
      System.out.println(ze.getName());
      zis.closeEntry();
    }

    zis.close();

  }
}

Written by

We are one of the initiators of the development of information technology in understanding the need for a solution that is familiar and close to us.

0 comments:

Post a Comment

 

© 2013 Klick Dev. All rights resevered.

Back To Top