code: private OffsetIndex createIndex(SegmentDescriptor descriptor) {
      return new DelegatingOffsetIndex(HeapBuffer.allocate(Math.min(DEFAULT_BUFFER_SIZE, descriptor.maxEntries()), OffsetIndex.size(descriptor.maxEntries())));
    }
docs: Creates an in memory segment index.