hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sachin Shetty" <sshe...@egnyte.com>
Subject How to stream a file via PUT to multiple HttpClients
Date Wed, 20 Jul 2011 10:02:38 GMT
Hi,

 

We have a unique case where we want to put a file via HTTP PUT to more than
one http servers  but we want to read the file only once which means we want
to read a block of data from the file and write  to two entities
simultaneously. Streaming the PUT and reading the file only once without
having to hold it in memory are the two things we cannot avoid.

 

These things are pretty easy when we have a direct outputstream to write to,
but I am not able to figure out how this can be achieved using the entities.

 

basically we want an httpclient equivalent of:

 

OutputStream stream1 = ...

OutputStream stream2 = ...

 

while (input.read(byte[1024]) {

   stream1.write(bytes);

   stream2.write(bytes);

}

 

Please let me know if there is a way out?

 

Thanks

Sachin


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message