[property2] value2 File f = new File("metadata.txt"); BufferedReader in = new BufferedReader(new FileReader(f)); String variable1 = ""; String variable2 = ""; Now read this file using a BufferedReader and getting the information in a certain order. Such as: variable1 = in.readLine(); variable2 = in.readLine(); I was wondering is there a better way to do this without having to read line by line? I was trying to think of using a loop but I'm not sure how that would work out since I want to set different String variables to each property. Also I'm not using a GUI in this program so that is the reason why I'm editing the data raw.
Alright so all 3 of you left the same answer. Thanks!
以上就是How to read a metadata file efficiently?的详细内容,更多请关注web前端其它相关文章!
未经允许不得转载:web前端首页 » JavaScript 答疑