apache-httpclient-4.xapache-httpclient-5.x

How can I migrate to apache httpclient5 about Zero Copy Get request


I am migrating to apache httpclient5 from apache httpclint 4.

I use the Zero Copy Get request process as follows. https://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java?view=markup

I download big files using this Zero Copy.

But, I can not find the Zero Copy process in the httpclient5.

How can I migrate this process?

Thank you.

I read the following document. https://hc.apache.org/httpcomponents-client-5.3.x/index.html


Solution

  • Zero-copy message body transfer is possible with HTTP/1.1 over plain connections only. It cannot work with HTTP of any version over TLS, with HTTP/2 (with an exception of tiny messages that can fit into a single DATA frame) and with HTTP/1.1 and chunk-coding.

    Overall, given the widespread use of TLS it was just not worth the effort, so for the time being there is no support for zero-copy message body transfer in HC 5.x