黑马程序员技术交流社区

标题: 求大神看一下,这个文件加密的代码哪里有问题,看好几遍,真心找不到错误点 [打印本页]

作者: pengyu1801    时间: 2014-8-14 17:41
标题: 求大神看一下,这个文件加密的代码哪里有问题,看好几遍,真心找不到错误点
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";
               
        }
}
作者: 爱上在路上    时间: 2014-8-14 18:32
我没看出来,楼下继续
作者: pengyu1801    时间: 2014-8-15 10:35
爱上在路上 发表于 2014-8-14 18:32
我没看出来,楼下继续

                 好吧




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2