Answers for "how to read large file in java"

1

Reading Large Files in Java

import java.io.*;

public class FileReaderWithBufferedReader {

    public static void main(String[] args) throws IOException{We
        String file = "src/file.txt";
        BufferedReader bufferedReader = new BufferedReader(new FileReader(file));

        String curLine;
        while ((curLine = bufferedReader.readLine()) != null){
            //process the line as required
            System.out.println(curLine);
        }
        bufferedReader.close();
    }
}
Posted by: Guest on September-14-2021

Code answers related to "how to read large file in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language