> +
> + //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));
> + hasher.putBytes(buffer, 0, bytesRead);
> + }
> +
> + //Rehash the queue until its size is 1.
> + while (q.size() > 1)
> + q = hashQueue(q);
> +
> + this.treeHash = q.poll().toString();
> + this.hash = hasher.hash().toString();
> + is.close();
Not exception-safe!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/9/files#r13771513