集册 Java实例教程 获取压缩的邮政编码条目大小

获取压缩的邮政编码条目大小

欢马劈雪     最近更新时间:2020-01-02 10:19:05

543
获取压缩的邮政编码条目大小


import java.io.IOException;/**n o w j a   v  a . c o m - 时  代  Java**/

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 zipFile = new ZipFile("c:/Folder/WebFiles.zip");


      Enumeration e = zipFile.entries();


      System.out.print("File Name");

      System.out.print("\t\t\t\tCompressed Size");

      while (e.hasMoreElements()) {/*来 自 N o w  J a v a  .   c o m*/

        ZipEntry entry = (ZipEntry) e.nextElement();

        String entryName = entry.getName();

        long compressedSize = entry.getCompressedSize();


        System.out.print(entryName);

        System.out.print("\t\t\t\t" + compressedSize);

        System.out.print(
展开阅读全文