
Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
roele said:
>> According to JavaDoc
>> i [sic] cant find anything about readLine() blocking.
You sometimes have to dig through the Javadocs to get to the answer.
<http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html>
> In general, each read request made of a Reader causes a corresponding read request to be made of the underlying character or byte stream.
OK, what does the underlying Reader's read() do? For that matter,
BufferedReader extends Reader:
<http://java.sun.com/javase/6/docs/api/java/io/Reader.html>
<http://java.sun.com/javase/6/docs/api/java/io/Reader.html#read()>
and related methods:
> This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.
<http://java.sun.com/javase/6/docs/api/java/io/Reader.html#read(char[])>
> This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.
<http://java.sun.com/javase/6/docs/api/java/io/Reader.html#read(char[],%20int,%20int)>
> This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.
QED.
You have to think through - if it says it's wrapping another method, then the
behavior of the wrapped method is relevant.

Signature
Lew
Patricia Shanahan - 11 Oct 2007 22:41 GMT
...
> You have to think through - if it says it's wrapping another method,
> then the behavior of the wrapped method is relevant.
There is a more direct way of looking at this. readLine's own
documentation says it does one of three things: throws an IOException to
report an error, returns null to indicate end of file, or returns a line.
readLine's documentation does not permit it to return until it either
has detected end of file or it has a complete line.
Patricia