What's the most efficient way to process a large text file line by line
<p>I (think) I'm processing a text file line by line until I find a specific token;</p>

<pre><code>(Psuedo Code)

Scanner scanner = new Scanner(new FileReader("myTextFile.txt");
while (scanner.hasNext() {
    boolean found = process(scanner.nextLine();
    if (found) return;
}
</code></pre>

<p>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?</p>
