public short[] getOffsets() {
    ByteBuffer buf = this.buffer.asReadOnlyBuffer();
    short[] ofs = new short[recordNum];
    buf.clear().position(SEG_HEADER_SIZE);
    buf.asShortBuffer().get(ofs);
    return ofs;
  }
If buffer position is set to begin of the segment, this methods extract length of it.

@param buffer
@return
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/WrappedSegment.java