Ok, thanks.

Feng

On 6/11/07, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 16:46 +0800, Feng Jiang wrote:
> Hi Oleg,
>
> thanks alot. but which method does you mean? I read stream in this way:
> InputStream is = method.getResponseBodyAsStream();
> is.read(...)
>
> Do you mean that I just only need to handle the IOException thrown by
the
> InputStream.read() method?

Yes, I do.

> Isn't there any other possibility that httpclient
> throws IOException not because the conneciton is closed?
>

There can be other causes for an IOException to be thrown while fetching
the response body such as malformed chunk encoding but the premature
termination of the connection by the peer or a connectivity problem are
the most likely ones.

Oleg


> Any way, Thanks a lot.
>
> Feng
>
> On 6/11/07, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
> >
> > On Mon, 2007-06-11 at 15:06 +0800, Feng Jiang wrote:
> > > Hi all,
> > >
> > > I need httpclient to fetching some large files, such as images,
videos.
> > In
> > > some cases, the server will close the connection before the fetching
> > process
> > > is done, so that I have only fetched a part of the whole file. In
this
> > case,
> > > I hope httpclient be able to tell me whether it fetched the whole
file,
> > or
> > > interrupted during the fetching process.
> > >
> > > Can httpclient do it?
> > >
> > > Thanks alot,
> > >
> > > Feng
> >
> > Hi Feng
> >
> > HttpClient will throw an IOException (most likely 'Connection reset by
> > peer' or some such) if the target server shuts down the connection
> > prematurely.
> >
> > Hope this helps
> >
> > Oleg
> >
> >
> > ---------------------------------------------------------------------
> > 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]


Reply via email to