Hello, Are you completely sure of that ? I just tried this available() thing while debugging after figuring out that no text seemed to be read. What I am actually doing is feeding the input stream to an InputFileReader/BufferedReader and parsing it in a while(reader.ready()) loop. Is there something wrong with that then ? Note that available() does return the size of the page when I am using Wikipedia's server.
Thank you for your help, Gaƫl On 2/17/07, Roland Weber <[EMAIL PROTECTED]> wrote:
Hello Gael, > The stream seems to be empty, > mystream.available() returns 0, but getResponseBodyAsString() does return > the content of the page. InputStream.available does NOT tell you how much bytes are in the stream. It tells you how much you can read _without_blocking_. If you call the read() method while available returns 0, it will simply block until some bytes become available or EOF is detected. http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html#available() cheers, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
