zoukankan      html  css  js  c++  java
  • 对于I/O流中解压中遇到的问题

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

    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();
            }
        }
    
    }
  • 相关阅读:
    Kernel panic
    elasticsearch5.4 安装篇
    nginx 切割日志文件
    dl 320e gen8 v2 安装2008 r2 系统
    idea开发配置
    红黑树
    二叉搜索树
    Object
    nginx
    docker
  • 原文地址:https://www.cnblogs.com/tangdeqiang/p/7680303.html
Copyright © 2011-2022 走看看