I (think) I'm processing a text file line by line until I find a specific token;
(Psuedo Code)
Scanner scanner = new Scanner(new FileReader("myTextFile.txt");
while (scanner.hasNext() {
boolean found = process(scanner.nextLine();
if (found) return;
}
Some of the files are huge. Does this code actually scan the file line by line or does either the Scanner or FileReader read the entire file into memory and then work it's way through the memory buffer line by line?