2013-03-19 44 views
0

我写的方法似乎无法访问。我下面粘贴的方法:方法method_name(FileInputStream,FileOutputStream)未定义类型Class_name

 public void decryt_data(InputStream in, OutputStream out) throws InvalidKeyException, IOException { 
     // initialize the cipher 
      cipher.init(Cipher.DECRYPT_MODE, secret_key);  
      // Bytes read from in will be decrypted 
      in = new CipherInputStream(in, cipher);    
      int numRead = 0; 
      while ((numRead = in.read(buf)) >= 0) 
      { 
       out.write(buf, 0, numRead); 
      } 
      out.close(); 
    } 

我试图使用类的一个实例如下调用这个方法: encryption.decrypt_data(new FileInputStream("C:/Users/Acer/Desktop/encrypted"),new FileOutputStream("C:/Users/Acer/Desktop/decrypted"));

Eclipse的告诉我:该方法decrypt_data(的FileInputStream, FileOutputStream中)是未定义的类型AES(即类名)

然而,下面的方法调用工作完全正常:

encryption.encrypt_data(new FileInputStream(fc.getSelectedFile().getPath()),new FileOutputStream("C:/Users/Acer/Desktop/encrypted"));

等待一些帮助:D谢谢。

+0

如果你有一个新的问题,请它作为一个单独的问题。彻底改变你的问题将它从答案中断开,并对没有帮助的人无益 – 2013-03-19 05:13:52

+0

好的。对不起。 – SidNoob 2013-03-19 07:59:02

+0

将其关闭为太本地化。这不是以任何方式惩罚你,只是因为拼写错误不太可能帮助其他任何人。 – 2013-03-20 00:08:57

回答

2

拼写错误decryt_data应该是decrypt_data

你的方法被调用public void decryt_data(InputStream in, OutputStream out),有一个p缺少decryt

+0

似乎我现在需要睡眠。非常感谢:D – SidNoob 2013-03-19 03:19:31

+0

我现在正面临一个新的错误。我修改了这个问题。 – SidNoob 2013-03-19 03:30:09

+0

这是一个新问题发布它作为一个新的问题,并将这个问题恢复到旧格式 – 2013-03-19 03:39:07

0

呼叫decryt_data()而不是decrypt_data()

相关问题