aspose file tools*
The moose likes I/O and Streams and the fly likes Buffered Reader not ready Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Buffered Reader not ready" Watch "Buffered Reader not ready" New topic
Author

Buffered Reader not ready

Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
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.

Thank You


Dilshan Edirisuriya SCJP1.4, SCWCD1.4, SCBCD 5
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

http://faq.javaranch.com/java/AvailableDoesntDoWhatYouThinkItDoes

The same applies to ready().


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
Thank you Rob for the reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Buffered Reader not ready