A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 位雪 中级黑马   /  2012-7-24 20:56  /  1824 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

  1. package cn.itcast.day2;
  2. import java.util.Date;
  3. public class ClassLoaderAttachment extends Date {
  4.         public String toString() {
  5.                    return "hello , itcast";
  6.         }
  7. }
复制代码
  1. package cn.itcast.day2;

  2. import java.io.FileInputStream;
  3. import java.io.FileOutputStream;
  4. import java.io.InputStream;
  5. import java.io.OutputStream;

  6. public class MyClassLoader {

  7. /**
  8. * @param args
  9. */
  10.             public static void main(String[] args) throws Exception{
  11.                          // TODO Auto-generated method stub
  12.                          String srcPath = args[0];
  13.                          String destDir = args[1];
  14.                         FileInputStream fis = new FileInputStream(srcPath);
  15.                         String destFileName = srcPath.substring(srcPath.lastIndexOf('\\')+1);
  16.                         String destPath = destDir + "\\" + destFileName;
  17.                         FileOutputStream fos = new FileOutputStream(destPath);
  18.                        cypher(fis,fos);
  19.                        fis.close();
  20.                        fos.close();
  21.        }

  22.        private static void cypher(InputStream ips,OutputStream ops) throws Exception {
  23.                 int b = -1;
  24.                while((b = ips.read())!=-1) {
  25.               ops.write(b ^ 0xff);
  26.               }
  27.        }
  28. }
复制代码
错误提示:

哪位能告诉我到底哪儿错了,找了半天都没找到。。。。

未命名.jpg (18.78 KB, 下载次数: 22)

未命名.jpg

未命名2.jpg (28.95 KB, 下载次数: 19)

未命名2.jpg

评分

参与人数 1技术分 +1 收起 理由
蒋映辉 + 1

查看全部评分

1 个回复

倒序浏览
系统找不到文件,应该是文件路径不对  
估计第一个参数的路径不正确  ...bin\cn\itcast\day2\ClassLoaderAttachment.class  
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马