- package mypackage;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.InputStream;
- import org.omg.CORBA_2_3.portable.OutputStream;
- public class ClassLoaderTest {
- /**
- * @param args
- */
- public static void main(String[] args) throws Exception{
- File srcFile = new File(args[0]);
- File destDir = new File(args[1]);
-
- FileInputStream fis = new FileInputStream(srcFile);
- File destFile = new File(destDir,srcFile.getName());
- FileOutputStream fos = new FileOutputStream(destFile);
- cypher(fis,fos);//编译不能通过,为什么呢?不是多态吗?求解
- }
- private static void cypher(InputStream is,OutputStream os)throws Exception
- {
- int b = -1;
- while((b=is.read())!=-1)
- os.write(b ^ 0xff);
- is.close();
- os.close();
- }
- }
复制代码 |
|