Interview Question
Software Engineer in TestsTeam: QA
Country: India
Interview Type: In-Person
if your file is text file then use BufferedReder else use InputStream.
Break the large file into small files based on the number of lines. Then read one by one.
Please comment if i am wrong.
For large files memory mapping of the file using FileChannel can be used. This is more efficient than opening and reading files. Following code can be used to map a file directly to memory buffer. This is an excerpt from FileChannel class document
"A region of a file may be mapped directly into memory; for large files this is often much more efficient than invoking the usual read or write methods."
- Prasanth June 12, 2013