How to read a metadata file efficiently?

My current project is using a metadata file to set properties without having to compile. Currently I have it set up in this way: metadata.txt [property] value
[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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准