Hi You can set the content range in a Get Method, code below works for me: private void addByteRangeHeader(Enclosure encl, GetMethod gMethod) {
int fileLen = new Long(encl.getFile().length()).intValue(); String contentRange = "bytes=" + new Integer((fileLen)).toString() + "-"; Header head = new Header(); head.setName("Range"); head.setValue(contentRange); gMethod.addRequestHeader(head); } Check for a: HttpStatus.SC_PARTIAL_CONTENT Cheers / Christophe ----- Original Message ----- From: "Peter Bleckmann" <[EMAIL PROTECTED]> To: <httpclient-user@jakarta.apache.org> Sent: Monday, June 06, 2005 7:26 PM Subject: 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]