> +      while (q.size() > 1) {
> +         
> result.offer(Hashing.sha256().hashBytes(Bytes.concat(q.poll().asBytes(), 
> q.poll().asBytes())));
> +      }
> +
> +      //If there is one hash left, add it too.
> +      if (q.size() == 1)
> +         result.offer(q.poll());
> +      return result;
> +   }
> +
> +   /**
> +    * Build a TreeHash based on a map of hashed chunks.
> +    *
> +    * @return The calculated TreeHash.
> +    */
> +   public static HashCode buildTreeHashFromMap(Map<Integer, HashCode> map) {

This method will be used by the multipart upload operation. The pair <Integer, 
HashCode> represents the part number and the hash for that part.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13791940

Reply via email to