title: Parsing Http Response with Apache HttpComponent no entity
body: <p>I want to parse following response in Java:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Mon, 23 May 2005 22:38:34 GMT
  Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
  Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
  ETag: "3f80f-1b6-3e1cb03b"
  Content-Type: text/html; charset=UTF-8
  Content-Length: 138
  Accept-Ranges: bytes
  Connection: close
  
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;An Example Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    Hello World, this is a very simple HTML document.
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>using <strong>Apache HttpComponent httpcore-4.4.3</strong></p>
  
  <p>So my code looks like:</p>
  
  <pre><code>  String response = "HTTP/1.1 200 OK\r\n" +
            "Date: Mon, 23 May 2005 22:38:34 GMT\r\n" +
            "Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)\r\n" +
            "Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT\r\n" +
            "ETag: \"3f80f-1b6-3e1cb03b\"\r\n" +
            "Content-Type: text/html; charset=UTF-8\r\n" +
            "Content-Length: 138\r\n" +
            "Accept-Ranges: bytes\r\n" +
            "Connection: close\r\n" +
            "\r\n" +
            "&lt;html\n" +
            "&lt;head&gt;\n" +
            "  &lt;title&gt;An Example Page&lt;/title&gt;\n" +
            "&lt;/head&gt;\n" +
            "&lt;body&gt;\n" +
            "  Hello World, this is a very simple HTML document.\n" +
            "&lt;/body&gt;\n" +
            "&lt;/html&gt;";
  
  ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(response.getBytes("UTF-8"));
  
  HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
  SessionInputBufferImpl inbuffer = new SessionInputBufferImpl(metrics, 8 * 1024);
  inbuffer.bind(byteArrayInputStream);
  
  HttpResponse httpResponse = new DefaultHttpResponseParser(inbuffer).parse();
  httpResponse.getEntity()
  </code></pre>
  
  <p>which I took from <a href="http://hc.apache.org/httpcomponents-core-ga/tutorial/html/advanced.html" rel="nofollow">http://hc.apache.org/httpcomponents-core-ga/tutorial/html/advanced.html</a> chapter 4.1.3. However parsed HttpResponse has <strong>null entity</strong></p>
  
  <p>Actually no matter what response I use (content with JSON, content with HTML, or even gzipped), it seems there is no content. What is wrong ?</p>