This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am using a BufferedReader to read remote site content of a web site. I am using ready() method to check whether the stream is ready and if so iterating through it. In some cases it does not enter into the loop cos the buffered ready is indicating it is NOT READY. Hence I used a thread sleep of 2 seconds to delay the process and it resulted in my expected output. So what will be the reason for this behavior and what will be the actual way I should write this.