黑马程序员,黑马论坛------求大神看一下,这个文件加密的代码哪里有问题,看好几遍,真心找不到错误点

来源:互联网 发布:淘宝在线自由布局工具 编辑:程序博客网 时间:2024/05/06 00:22

文章来源:黑马程序员,黑马论坛

 

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class MyClassLoader  extends ClassLoader{
        public static void main(String[] args) throws Exception {
                String  srcPath=args[0];
                String  destDir=args[1];
                FileInputStream  fis=new FileInputStream(srcPath);
        String destFileName=srcPath.substring(srcPath.lastIndexOf(
                        '\\')+1);
        String destPath=destDir+"\\"+destFileName;
        FileOutputStream  fos=new FileOutputStream(destPath);
        cypher(fis,fos);
        }

        public static void cypher(FileInputStream ips, FileOutputStream ops) throws Exception {
                int b=-1;
                while ((b=ips.read())!=-1) {
                        ops.write(b ^ 0xff);
                       
                }       
        }
import java.util.Date;

public class ClassLoaderAttachment extends Date {
        public String  toString(){
                return "hello,itcast";
               
        }
}

0 0