HỎI Cách đọc file text lớn trong java

Joe

Thành viên VIP
21/1/13
2,935
1,304
113
Use NIO FileChannel with ByteBuffer. Example
Java:
FileChannel fc = (new FileInputStream("myBigFile.txt")).getChannel();
ByteBuffer bb = ByteBuffer.allocate(10000000); // 10MB
...
More about FileChannel: click HERE
@QuangTrung93 : Posting a screenshot is unacceptable for me and for most of the other members because no one has time to type the codes if he/she wants to reproduce the error. read THIS for the next time if you want to ask for something.
Stackoverflow is GOOD but NOT the most omnipotent in this universe :D
 
Sửa lần cuối:
  • Like
Reactions: QuangTrung93