static SchemaPage loadSchemaPage(ByteBuffer buffer) throws MetadataException {
    buffer.clear();
    byte pageType = ReadWriteIOUtils.readByte(buffer);

    switch (pageType) {
      case SchemaFileConfig.SEGMENTED_PAGE:
        return new SegmentedPage(buffer);
      case SchemaFileConfig.INTERNAL_PAGE:
        return new InternalPage(buffer);
      case SchemaFileConfig.ALIAS_PAGE:
        return new AliasIndexPage(buffer);
      default:
        throw new MetadataException(
            "ByteBuffer is corrupted or set to a wrong position to load as a SchemaPage.");
    }
  }
<b>Page Header Structure: (23 bytes used, 9 bytes reserved)</b>

<ul>
  <li>1 byte: page type indicator
  <li>1 int (4 bytes): pageIndex, a non-negative number
  <li>1 short (2 bytes): spareOffset, bound of the variable length part in a slotted structure
  <li>1 short (2 bytes): spareSize, space left to use
  <li>1 short (2 bytes): memberNum, amount of the member whose type depends on implementation
  <li>1 long (8 bytes): firstLeaf, points to first segmented page, only in {@link InternalPage}
  <li>1 int (4 bytes): subIndexPage, points to sub-index, only in {@link InternalPage}
</ul>

<p>While header of a page is partly fixed, the body is dependent on implementation.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/ISchemaPage.java