code: private void initialize(ByteArraySegment footer, long footerOffset, long indexLength) {
          if (footer.getLength() != FOOTER_LENGTH) {
              throw new IllegalDataFormatException(String.format("Wrong footer length. Expected %s, actual %s.", FOOTER_LENGTH, footer.getLength()));
          }
  
          long rootPageOffset = getRootPageOffset(footer);
          int rootPageLength = getRootPageLength(footer);
          if (rootPageOffset + rootPageLength > footerOffset) {
              throw new IllegalDataFormatException(String.format("Wrong footer information. RootPage Offset (%s) + Length (%s) exceeds Footer Offset (%s).",
                      rootPageOffset, rootPageLength, footerOffset));
          }
  
          setState(indexLength, rootPageOffset, rootPageLength);
      }
docs: Initializes the BTreeIndex using information from the given footer.
  
  @param footer       A ByteArraySegment representing the footer that was written with the last update.
  @param footerOffset The offset within the data source where the footer is located at.
  @param indexLength  The length of the index, in bytes, in the data source.