Hi Friends,
I am trying to read some characters from a file but it's adding some unknown characters to it. The source file has this line:
0??0
I use this code to read the characters from the source file:
File inputfile = new File("myfile.txt");
FileInputStream from = new FileInputStream(inputfile);
byte [] buffer = new byte[4096];
int charsread;
while((charsread = from.read(buffer)) != -1);
from.close();
String text = new String(buffer);
text = text.trim();
String publickey = text.toLowerCase();
But the output has an extra '?' symbol in it i.e.
0?0
Basicallty, the file i am trying to read is a rsa public key and I am not sure if it has to do something with encoding. Can someone please help?
Thanks