У меня есть большой тестовый файл с 70 миллионами строк текста. Я должен прочитать файл строки за строкой.
Я использовал два разных подхода:
InputStreamReader isr = new InputStreamReader(new FileInputStream(FilePath),"unicode");
BufferedReader br = new BufferedReader(isr);
while((cur=br.readLine()) != null);
и
LineIterator it = FileUtils.lineIterator(new File(FilePath), "unicode");
while(it.hasNext()) cur=it.nextLine();
Есть ли другой подход, который может ускорить выполнение этой задачи?
С наилучшими пожеланиями,