My problem is when I get the data from a text file it seems to be in the wrong encoding or somthing. I dont know how to get around this issue sorry. Thanks in advance. Here is the code.
private static String readLogFile(String path, File f) throws IOException {
if (f.exists()){
String data;
try (RandomAccessFile raf = new RandomAccessFile(f, "rw")) {
char ch = raf.readChar();
raf.seek(f.length());
String dataCh = String.valueOf(ch);
data = dataCh.toString();
System.out.println(data);
}
return data;
}
else{
String data = "";
return data;
}
}
RandomAccessFileat all when you are just reading the start of it?