开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜