Reading from a BufferedReader (readLine) returns null?

后端 未结 1 1047
借酒劲吻你
借酒劲吻你 2021-01-14 05:46

I am currently trying to read a String from a BufferedReader but cant find a way to do this...

Of course I tried

BufferedR         


        
1条回答
  •  执念已碎
    2021-01-14 06:17

    Based on the documentation, the BufferedReader.readLine() returns null only when the end of the stream is reached. This means if the first call to readLine() returns null, there was nothing in the input stream to begin with.

    0 讨论(0)
提交回复
热议问题