@Max Zoome - , : infinite. :
String line;
while (myScanner.hasNextLine() && (line=myScanner.nextLine()!=null))
{
}
line by line, BufferedReader, ,
Since it is Scannerused to parse tokens from the contents of the stream, as well as BufferedReader- synchronized, but Scanner- no.
FileReader in = new FileReader("yourFileName");
BufferedReader br = new BufferedReader(in);
while ((line=br.readLine()) != null) {
System.out.println(line);
}
in.close();
source
share