> @@ -158,9 +158,8 @@ private Blob createUpdatedCopyOfBlobInContainer(String 
> containerName, Blob in) {
>        try {
>           if (payload == null || !(payload instanceof ByteArrayPayload)) {
>              MutableContentMetadata oldMd = 
> in.getPayload().getContentMetadata();
> -            ByteArrayOutputStream out = new ByteArrayOutputStream();
> -            in.getPayload().writeTo(out);
> -            payload = (ByteArrayPayload) 
> Payloads.calculateMD5(Payloads.newPayload(out.toByteArray()));
> +            byte[] out = ByteStreams.toByteArray(in.getPayload());
> +            payload = (ByteArrayPayload) 
> Payloads.calculateMD5(Payloads.newPayload(out));

This has the same memory consumption as before.  A subsequent commit will 
leverage Guava 16 HashingInputStream to calculate the MD5 hash and store the 
byte array to disk for the filesystem blobstore and in-memory for transient 
while minimizing memory use.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/301/files#r9968606

Reply via email to