集册 Java实例教程 获取邮政编码输入的压缩方法

获取邮政编码输入的压缩方法

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

486
获取邮政编码输入的压缩方法


import java.io.File;/* 来自 n o w    j a v a  . c o m*/

import java.io.IOException;

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();

                        while(e.hasMoreElements())

                        {/* 来 自 NowJava.com - 时代Java*/

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

                                 int method = entry.getMethod();

                                 

                                 if(method == ZipEntry.DEFLATED)

                                        System.out.println(entry.getName() + "\t\t\t\tDeflated");

                                 else if(method == ZipEntry.STORED)

                                        System.out.println(entry.getName() + "\t\t\t\tStored");

                                 else if(method == -1)

                                        System.out.println(entry.getName() + "\t\t\t\tNot Specified");

                                                          
展开阅读全文