I have some few files of different extensions like .rdf, .pkg,.fmb,.sql and .ldt. In these files I have to find that some specific keywords are present or not. So for this purpose I used two ways.
1st approach
String content = FileUtils.readFileToString(file);
2nd approach
byte[] b = FileUtils.readFileToByteArray(fl);
String read = new String(b);
now after getting these strings I search the keywords. The problem is I'm not sure whether from these approaches I'll be able to scan the entire file or not. Since those files are not text files so When I print these Strings in console , half the text is no readable. So I'm not sure whether this approach gives me the correct result or not. Please tell me how these two methods work. And will it give me all the keywords present in those files or not. Please guide.