How to read several lines from text file into memory?
I have a file with the structure like so: http://gamedev.pastebin.com/8iESYTVY
but 开发者_运维知识库it's much bigger in size, 233MB, how can I read blocks of lines, enough lines to represent 10MB, into memory so I won't have to read in the whole file?You could use Java nio, which allow random access to a file. Or, in other words, allows mapping a file to memory, allowing your Java program to access it permanently at random locations.
精彩评论