U
U
Urukhayy2017-03-22 08:57:15
Java
Urukhayy, 2017-03-22 08:57:15

Can strings from System.in go to BufferedReader(InputStreamReader) "discontinuously"?

For example: The System.in input should be a million lines (or even more). Then while is done until null is encountered . But can it be that null gets hit before a million rows are finished? For example, due to the low byte feed rate of System.in input? Will he wait for a new "portion" himself, or will the cycle end ahead of time?

BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));

String bufferedValue = bufferRead.readLine();

while(bufferedValue != null) {
    // actions
    bufferedValue = bufferRead.readLine();
}

If so, what is the best way to read large streams of strings from System.in?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hland, 2017-03-22
@Hland

System.in keyboard input stream. Zero will not be there, it will be due to the slow supply of characters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question