public class MyEncoderText {
public static void main(String[] args)throws Exception {
String path0=args[0];
String path1=args[1];
FileInputStream in=new FileInputStream(path0);
FileOutputStream out=new FileOutputStream(path1);
cypher(in,out); //为什么在这里会出错,The method cypher(InputStream, OutputStream) in the type MyEncoderText is not applicable //for the arguments (FileInputStream, FileOutputStream)
System.out.println("结束");
out.close();
}
private static void cypher(InputStream inp,OutputStream oup)throws Exception{
int len=-1;
System.out.println("0: "+len);
while ((len=inp.read())!= -1){
System.out.println("1: "+len);
oup.write(len^102^91);
System.out.println("2: "+len);
}
System.out.println("3: "+oup);
}
}
为什么运行会出错?The method cypher(InputStream, OutputStream) in the type MyEncoderText is not applicable for the arguments (FileInputStream, FileOutputStream)
不能将FileInputSrteam类型的对象传入到参数类型为InputStream的方法中吗?
|