im using a function called decrypt to decrypt my encrypted strings in a file using the bufferedreader but the problem is when i use the function it throws NullPointerException, can any one help me? Thanks in advance!
This is my functon:
public String Decrypt (String Word,int key)
{
String result="";
for (int i=0;i<Word.length();i++)
{
result+=(char)(Word.charAt(i)-key);
}
return result;
}
bufferedreader code:
try {
BufferedReader out=new BufferedReader(new FileReader("array.txt"));
String line="";
while((line=Decrypt(out.readLine(), 30)) !=null) // unknown exception
{
output.append("Your String is: \n"+ line);
}
}catch (FileNotFoundException ex) {
} catch (IOException ex) {
}