This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes InputStreamReader returns null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "InputStreamReader returns null" Watch "InputStreamReader returns null" New topic
Author

InputStreamReader returns null

Rob Brew
Ranch Hand

Joined: Jun 23, 2011
Posts: 101
HI all

I'm writing the word "load" to a server and expexting a reply in the form of a string array. The program exits on readLine() returning null



Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19747
    
  10

You call the method several times, and you didn't say which of them causes the problem, so let me simply point out that BufferedReader's readLine() method is designed to return null after it reaches the end of its underlying data stream. There's nothing abnormal about that. It's up to your code to deal with the possibility.
Rob Brew
Ranch Hand

Joined: Jun 23, 2011
Posts: 101
the null pointer exception occurs at line 46 of the ClientChat Class. The program battleserver claims to be sending data to the pipe.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: InputStreamReader returns null
 
It's not a secret anymore!