title: Use HttpCore + HttpNIO from Apache for HTTP Pipelining on Android?
body: <p>Android uses Apache's HTTP Components library to perform HTTP requests and exposes an API that doesn't support asynchronous requests or pipelining. We're writing an app that would benefit from pipelining so we are using <a href="http://bruno.biasedbit.com/blag/2010/08/23/pipelining-support-in-hotpotato/" rel="nofollow">Hotpotato</a> to perform those requests. In an effort to reduce the size of the APK (Hotpotato and Netty add ~2-4MB to the APK size) we're looking to implement our own on top of HttpCore and HttpNIO.</p>
  
  <p>The Apache <a href="http://hc.apache.org/httpcomponents-core-ga/tutorial/html/nio.html" rel="nofollow">NIO extensions docs</a> have an obscure reference to pipelining, mentioning that "non-blocking HTTP connections [are] fully pipelining capable", and there's <a href="https://issues.apache.org/jira/browse/HTTPCLIENT-258" rel="nofollow">a bug</a> on the HttpClient code that mentions pipelining support, but there's no mention of how to implement it.</p>
  
  <p>How do I use Apache's HTTP Components to implement support for HTTP pipelining and persistent connections on top of Android's existing Apache HTTP components libraries?</p>