> +import com.google.common.primitives.Bytes;
> +
> +/**
> + * Calculates the linear hash and the tree hash of the payload.
> + */
> +public class TreeHasher {
> +
> + private static int CHUNK_SIZE = 1024 * 1024;
> +
> + private final Payload payload;
> + private HashCode hash;
> + private HashCode treeHash;
> +
> + public TreeHasher(Payload payload) throws IOException {
> + this.payload = payload;
> + this.buildHashes();
This ends up doing I/O in a constructor, which I guess is in general something
to avoid, if possible? How much more complicated would it be to calculate this
on first use? Also, would it make sense to make this a `Supplier<HashCode>`, or
so?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/11/files#r13790648