function initialize(hierarchy, hierarchyJson, binaryBody) {
  let i;
  let classId;
  let binaryAccessor;

  const instancesLength = hierarchyJson.instancesLength;
  const classes = hierarchyJson.classes;
  let classIds = hierarchyJson.classIds;
  let parentCounts = hierarchyJson.parentCounts;
  let parentIds = hierarchyJson.parentIds;
  let parentIdsLength = instancesLength;
  let byteLength = 0;

  if (defined(classIds.byteOffset)) {
    classIds.componentType =
      classIds.componentType ?? ComponentDatatype.UNSIGNED_SHORT;
    classIds.type = AttributeType.SCALAR;
    binaryAccessor = getBinaryAccessor(classIds);
    classIds = binaryAccessor.createArrayBufferView(
      binaryBody.buffer,
      binaryBody.byteOffset + classIds.byteOffset,
      instancesLength,
    );
    byteLength += classIds.byteLength;
  }

  let parentIndexes;
  if (defined(parentCounts)) {
    if (defined(parentCounts.byteOffset)) {
      parentCounts.componentType =
        parentCounts.componentType ?? ComponentDatatype.UNSIGNED_SHORT;
      parentCounts.type = AttributeType.SCALAR;
      binaryAccessor = getBinaryAccessor(parentCounts);
      parentCounts = binaryAccessor.createArrayBufferView(
        binaryBody.buffer,
        binaryBody.byteOffset + parentCounts.byteOffset,
        instancesLength,
      );
      byteLength += parentCounts.byteLength;
    }
    parentIndexes = new Uint16Array(instancesLength);
    parentIdsLength = 0;
    for (i = 0; i < instancesLength; ++i) {
      parentIndexes[i] = parentIdsLength;
      parentIdsLength += parentCounts[i];
    }

    byteLength += parentIndexes.byteLength;
  }

  if (defined(parentIds) && defined(parentIds.byteOffset)) {
    parentIds.componentType =
      parentIds.componentType ?? ComponentDatatype.UNSIGNED_SHORT;
    parentIds.type = AttributeType.SCALAR;
    binaryAccessor = getBinaryAccessor(parentIds);
    parentIds = binaryAccessor.createArrayBufferView(
      binaryBody.buffer,
      binaryBody.byteOffset + parentIds.byteOffset,
      parentIdsLength,
    );

    byteLength += parentIds.byteLength;
  }

  const classesLength = classes.length;
  for (i = 0; i < classesLength; ++i) {
    const classInstancesLength = classes[i].length;
    const properties = classes[i].instances;
    const binaryProperties = getBinaryProperties(
      classInstancesLength,
      properties,
      binaryBody,
    );
    byteLength += countBinaryPropertyMemory(binaryProperties);
    classes[i].instances = combine(binaryProperties, properties);
  }

  const classCounts = new Array(classesLength).fill(0);
  const classIndexes = new Uint16Array(instancesLength);
  for (i = 0; i < instancesLength; ++i) {
    classId = classIds[i];
    classIndexes[i] = classCounts[classId];
    ++classCounts[classId];
  }
  byteLength += classIndexes.byteLength;

  hierarchy._classes = classes;
  hierarchy._classIds = classIds;
  hierarchy._classIndexes = classIndexes;
  hierarchy._parentCounts = parentCounts;
  hierarchy._parentIndexes = parentIndexes;
  hierarchy._parentIds = parentIds;
  hierarchy._byteLength = byteLength;
}
Parse the batch table hierarchy from the
<code>3DTILES_batch_table_hierarchy</code> extension.

@param {BatchTableHierarchy} hierarchy The hierarchy instance
@param {object} hierarchyJson The JSON of the extension
@param {Uint8Array} [binaryBody] The binary body of the batch table for accessing binary properties
@private