> +
> + /**
> + * Build the Hash and the TreeHash values of the payload.
> + */
> + private void buildHashes() throws IOException {
> + InputStream is = null;
> + try {
> + is = payload.openStream();
> + Queue<HashCode> q = Lists.newLinkedList();
> + HashingInputStream linearHis = new
> HashingInputStream(Hashing.sha256(), is);
> + while (true) {
> + HashingInputStream chunkedHis = new HashingInputStream(
> + Hashing.sha256(), ByteStreams.limit(linearHis,
> CHUNK_SIZE));
> + long count = ByteStreams.copy(chunkedHis,
> ByteStreams.nullOutputStream());
> + if (count == 0) {
> + break;
Is this guaranteed to happen?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13790679