JarEntry: getCompressedSize() : JarEntry « java.util.jar « Java by API






JarEntry: getCompressedSize()

  
import java.io.IOException;
import java.util.Date;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

public class Main {

  public static void main(String[] args) throws IOException {

    JarFile jf = new JarFile(args[0]);
    Enumeration e = jf.entries();
    while (e.hasMoreElements()) {
      JarEntry je = (JarEntry) e.nextElement();
      String name = je.getName();
      Date lastModified = new Date(je.getTime());
      long uncompressedSize = je.getSize();
      long compressedSize = je.getCompressedSize();

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

   
    
  








Related examples in the same category

1.JarEntry: getAttributes()
2.JarEntry: getComment()
3.JarEntry: getCrc()
4.JarEntry: getName()
5.JarEntry: getSize()
6.JarEntry: getTime()
7.JarEntry: isDirectory()
8.JarEntry: setTime(long time)