ZipEntry: getCompressedSize() : ZipEntry « java.util.zip « Java by API






ZipEntry: getCompressedSize()

 
import java.io.IOException;
import java.util.Date;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class Main {
  public static void main(String[] args) {
    try {
      ZipFile zf = new ZipFile("your.zip");
      Enumeration e = zf.entries();
      while (e.hasMoreElements()) {
        ZipEntry ze = (ZipEntry) e.nextElement();
        String name = ze.getName();
        Date lastModified = new Date(ze.getTime());
        long uncompressedSize = ze.getSize();
        long compressedSize = ze.getCompressedSize();

        System.out.println(name);
        System.out.println(lastModified);
        System.out.println(uncompressedSize);
        System.out.println(compressedSize);

      }
    } catch (IOException ex) {
      System.err.println(ex);
    }
  }
}

   
  








Related examples in the same category

1.ZipEntry.DEFLATED
2.ZipEntry.STORED
3.new ZipEntry(String name)
4.ZipEntry: getComment()
5.ZipEntry: getCrc()
6.ZipEntry: getName()
7.ZipEntry: getSize()
8.ZipEntry: getTime()
9.ZipEntry: isDirectory()