Hello,

I have the following code that I am using with an httpclientasync client:

          void put(File file, Map<String, String> headers)
          {

              HttpPut put = new HttpPut(url);
              InputStream is = new FileInputStream(file);
              InputStreamEntity entity = new InputStreamEntity(dataStream, -1);
              put.setEntity(entity);
              for (String header : headers.keySet())
              {
                     put.addHeader(header, headers.get(header));
              }
              if (entity.getContentType() == null && 
!put.containsHeader(HttpHeaders.CONTENT_TYPE))
              {
                     put.addHeader(HttpHeaders.CONTENT_TYPE, 
HTTP.DEF_CONTENT_CHARSET.name());
              }
              Future<HttpResponse> rc = client.execute(put, context, null);

          }

I would like to use a ZeroCopyPut in this code to avoid the copy into user 
land. Is it possible to do this?
I have seen the zero copy example, but I don't know how to adapt it to this 
function here.

Thanks!
Aaron





This e-mail may contain confidential and/or privileged information for the sole 
use of the intended recipient. 
Any review or distribution by anyone other than the person for whom it was 
originally intended is strictly prohibited. 
If you have received this e-mail in error, please contact the sender and delete 
all copies. 
Opinions, conclusions or other information contained in this e-mail may not be 
that of the organization.

Reply via email to