title: Migration from HTTPClient 3.1 to 4.3.3, Method.getResponseBody(int)
body: <p>I'm updating an old software using HTTPClient 3.1 to use HTTPClient 4.3.3.
  I noticed that in the old code there is a specific requirement: when getting a remote page/resource the client is able to verify the dimension, generating an exception if the content is too big WITHOUT downloading the full resource.
  This was accomplished in the following manner:</p>
  
  <pre><code>int status = client.executeMethod(method);
  ...
  byte[] responseBody= method.getResponseBody(maxAllowedSize+1);
  </code></pre>
  
  <p>Notice the "+1" after maxAllowedSize: it's requested to have a proof that the original page/resource was in fact too big.
  If the last byte was used, an exception was thrown; otherwise the page was processed.</p>
  
  <p>I'm trying to implement the same thing in HTTPClient 4.3.3, but I can't find a way to download only a defined number of bytes from the server... this is critical in my application.
  Can you help me? Thank you in advance.</p>
  
  <p>Javadoc of the old getResponseBody(int) method: <a href="https://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpMethodBase.html#getResponseBody(int)" rel="nofollow">https://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpMethodBase.html#getResponseBody(int)</a></p>