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