> +      return q.poll().toString();
> +   }
> +
> +   /**
> +    * Build the Hash and the TreeHash values of the payload.
> +    */
> +   public void buildHashes() throws IOException {
> +      InputStream is = payload.openStream();
> +      Hasher hasher = Hashing.sha256().newHasher();
> +      Queue<HashCode> q = Lists.newLinkedList();
> +
> +      //Divide the payload in chunks and queue them.
> +      byte[] buffer = new byte[CHUNK_SIZE];
> +      int bytesRead;
> +      while ((bytesRead = is.read(buffer)) >= 0) {
> +         q.offer(Hashing.sha256().hashBytes(buffer, 0, bytesRead));

Can you rewrite this with `HashingInputStream` to avoid buffering `CHUNK_SIZE` 
bytes?

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

Reply via email to