static createIndexTypedArray(indexDatatype, size) {
    //>>includeStart('debug', pragmas.debug);
    Check.typeOf.number.greaterThanOrEquals("size", size, 0);
    //>>includeEnd('debug');

    switch (indexDatatype) {
      case IndexDatatype.UNSIGNED_BYTE:
        return new Uint8Array(size);
      case IndexDatatype.UNSIGNED_SHORT:
        return new Uint16Array(size);
      case IndexDatatype.UNSIGNED_INT:
        return new Uint32Array(size);
    }
    throw new DeveloperError(
      `The indexDatatype must be UNSIGNED_BYTE (${IndexDatatype.UNSIGNED_BYTE}, ` +
        `UNSIGNED_SHORT (${IndexDatatype.UNSIGNED_SHORT}, or ` +
        `UNSIGNED_INT (${IndexDatatype.UNSIGNED_INT}, but is ${indexDatatype}`,
    );
  }
Create a typed array with a type that matches the given index data type,
and the given size.

@param {number} indexDatatype The <code>IndexDataType</code>
@param {number} size The size of the array that will be created
@returns {TypedArray} The typed array
@throws {DeveloperError} If the <code>indexDataType</code> is neither
<code>UNSIGNED_BYTE</code>, nor <code>UNSIGNED_SHORT</code>,
nor <code>UNSIGNED_INT</code>, or the size is negative.