hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: Using GetMethod with offset
Date Mon, 06 Jun 2005 12:45:09 GMT
Hello Peter,

this has nothing to do with the InputStream. That stream
will always be positioned at the beginning of the response
body. But you can ask the server to return only portions
of a document by sending an appropriate Range header.

It is up to your application to set the Range header in the
request, to verify that the server actually sent only a range
of the file, or to decode the multipart format if the server
sends the response as several parts with individual range

Check out RFC 2616 (HTTP/1.1), sections 14.35, 3.12,
14.16, 14.5, 19.2 and several others.

If you send only a single range specification and there
is no interference from range-caching proxies, the
complexity should be manageable. If you get multipart
responses, things get ugly.

hope that helps,

Peter Bleckmann <blepe@xinit.org> 
06.06.2005 13:26
Please respond to
"HttpClient User Discussion"


Using GetMethod with offset

Hi List!

I got a question about how to define an offset for the GetMethod. 
What i am doing so far is to generate
an InputStream  using the getResponseBodyAsStream() method for 
reading a huge binary file from a
web server. For some reason I don`t want to read the entire file but 
only a "small" subset of the data,
starting somewhere in the file. Using the skip() method (or things 
like that) to reach the "point of interest"
in the input stream is not what I want as will transfer all skipped 
bytes. So my question is, how to obtain
an InputStream starting at a given offset.

Thanks for any advice, Peter

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message