首页 > 其他 > 详细

对于I/O流中解压中遇到的问题

时间:2017-10-17 11:02:55      阅读:232      评论:0      收藏:0      [点我收藏+]

今天早上打了一个程序,是关于解压文件的,但是在运行时程序不报错,也不提示,运行结果没有任何信息,在没有办法的情况下,用命令提示符运行了一下 ,编译没有问题,但是在运行时出现了无法找到主类或者加载主类。出现这一结果,我以为是我的类名和文件的名不符,但是在找了好几遍之后,仍然没有找出错误,并且在群里也问了一些人,也没有找出错误,对于这个问题,我想以后慢慢的深究,希望能得出答案!现在给出完整程序如下,希望看到有知道的人给我指点一下!在此表示感谢!

package com.tangdeqiang.rtbc5;

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

public class TestInputZip{

    public static void main(String[] temp){
        
        ZipInputStream zin;
        try{
            zin=new ZipInputStream(new FileInputStream("d:\\hello.zip"));
            ZipEntry entry=zin.getNextEntry();
            while(((entry=zin.getNextEntry())!=null)&&!entry.isDirectory()){
                File file=new File("d:\\"+entry.getName());
                System.out.println(file);
                if(!file.exists()){
                    file.mkdirs();
                    file.createNewFile();
                }
                zin.closeEntry();
                System.out.println(entry.getName()+"解压成功");
            }
            zin.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }

}

 

对于I/O流中解压中遇到的问题

原文:http://www.cnblogs.com/tangdeqiang/p/7680303.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!