code: private static int[] computeOrigins(int[] sizes, int offset) {
          int count = sizes.length;
          int[] origins = new int[count + 1];
          origins[0] = offset;
          for (int i = 1; i <= count; i++) {
              origins[i] = origins[i - 1] + sizes[i - 1];
          }
          return origins;
      }
docs: Computes origins from sizes taking the specified offset into account.
  
  @param sizes the array of sizes
  @param offset an offset for the first origin
  @return an array of origins