On Wed, 2006-05-24 at 21:46 +0100, David Harrigan wrote:
> Hi,
>
> Thanks Oleg for your reply, but it does prompt some others...
>
> If ready is not to be used, what is the recommended way to see if there
> is data available from the server?
>
Unfortunately InputStream#read is the only reliable means I personally
know of in the classic (java.io) I/O model. java.nio, of course,
provides selectors for that end.
> I've switched to using ChunkedInputStream from the HttpCore package, but
> it requires a HttpDataReceiver rather than an inputstream, so I extended
> AbstractHttpDataReceived calling super.init(inputStream, 16) in my extended
> class.
>
> I've hooked that up to the ChunkedInputStream now
>
> return new BufferedReader(new InputStreamReader(new ChunkedInputStream(new
> MyHttpDataReceiver(inputStream, 16))));
>
> Yet I can't seem to get data in! Here's MyHttpDataReceiver:
>
>
> class MyHttpDataReceiver extends AbstractHttpDataReceiver {
>
> public MyHttpDataReceiver(InputStream inputStream, int bufferSize) {
> super.init(inputStream, bufferSize);
> }
>
> public boolean isDataAvailable(int arg0) throws IOException {
> return true;
> }
>
> }
>
That does not seem to make any sense. Please use
o.a.http.impl.io.SocketHttpDataReceiver since you said you wanted to
attach chunked input stream to a raw socket
Oleg
>
> You can see I'm always returning true (just in case!) :)
>
> Sorry, but I'm stuck!
>
> Any help?
>
> -=david=-
>
>
>
>
> This email and the files transmitted with it are meant solely for the use of
> the individual addressee(s) named above. They may contain confidential and/or
> legally privileged information. If you are not the addressee(s) or
> responsible for delivery of the message to the addressee(s), please delete it
> from your system and contact the sender right away. The opinions, conclusions
> and other information in this message which do not relate to the official
> business of Wanadoo UK plc are not necessarily endorsed by it. Wanadoo UK plc
> has taken steps to ensure that this email and any attachments are virus-free,
> but it remains your responsibility to confirm and ensure this.
>
> Wanadoo UK plc is a subsidiary of France Telecom SA. Our registered office is
> at: Verulam Point, Station Way, St. Albans, Herts, AL1 5HE, and we are
> registered in England and Wales, as Company No. 3014367
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]