title: How to handle huge data from a REST service
body: <p>We are using a REST service that returns huge data.
  In production, the server hardware can handle it.
  I need to test the REST service by getting the data on my local machine,
  which cannot handle the huge data.
  My local machine is a 4G i5.
  I am getting out of memory exception every time I hit the service. </p>
  
  <p><code>response.getStatus()</code>  returns 200 status.
  But while collecting the data using input stream reader, I get an out of memory exception. </p>
  
  <pre><code>BufferedReader br = new BufferedReader(new
  InputStreamReader(newByteArrayInputStream(response.getEntity().getBytes())));
  </code></pre>
  
  <p>Is there any other way to collect the data without hitting the memory exception? </p>
  
  <p>I tried pushing my VM size to 2G but, it still doesn't work.</p>