I feel like this is a bad practice to store a file inside a string. Is there an alternative way to do this, because I want to compare a list of keys and do an indexOf(key) on the file. The key could be anywhere in the file.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use a BufferedReader to pull in the data a chunk at a time:
…
and test each small string. You’d need to keep track of the index, but this would use much less memory.