code: public void delete() {
      Buffer buffer = this.buffer instanceof SlicedBuffer ? ((SlicedBuffer) this.buffer).root() : this.buffer;
      if (buffer instanceof FileBuffer) {
        ((FileBuffer) buffer).delete();
      } else if (buffer instanceof MappedBuffer) {
        ((MappedBuffer) buffer).delete();
      }
  
      offsetIndex.delete();
    }
docs: Deletes the segment.