> +      return from + "-" + to;
> +   }
> +
> +   public static class Builder {
> +      public static ContentRange fromString(String contentRangeString) {
> +         if (!contentRangeString.matches("[0-9]+-[0-9]+"))
> +            return null;
> +         Iterator<String> strings = 
> Splitter.on('-').split(contentRangeString).iterator();
> +         long from = Long.parseLong(strings.next());
> +         long to = Long.parseLong(strings.next());
> +         return new ContentRange(from, to);
> +      }
> +
> +      public static ContentRange fromPartNumber(long partNumber, int 
> partSizeInMB) {
> +         long from = partNumber * partSizeInMB;
> +         long to = from + (partSizeInMB << 20) - 1;

Promote partSizeInMB to long?  If partSizeInMB is MAX_PART_SIZE = 4096, then 
this will overflow the int.

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

Reply via email to