- package cn.itcast.day2;
- import java.util.Date;
- public class ClassLoaderAttachment extends Date {
- public String toString() {
- return "hello , itcast";
- }
- }
复制代码- package cn.itcast.day2;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.InputStream;
- import java.io.OutputStream;
- public class MyClassLoader {
- /**
- * @param args
- */
- public static void main(String[] args) throws Exception{
- // TODO Auto-generated method stub
- 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);
- fis.close();
- fos.close();
- }
- private static void cypher(InputStream ips,OutputStream ops) throws Exception {
- int b = -1;
- while((b = ips.read())!=-1) {
- ops.write(b ^ 0xff);
- }
- }
- }
复制代码 错误提示:
哪位能告诉我到底哪儿错了,找了半天都没找到。。。。 |
|