slice

abstract fun slice(sliceDescription: String, offset: Long, length: Long): IndexInput

Creates a slice of this index input, with the given description, offset, and length. The slice is sought to the beginning.


open fun slice(sliceDescription: String, offset: Long, length: Long, readAdvice: ReadAdvice): IndexInput

Create a slice with a specific ReadAdvice. This is typically used by [ ] implementations to honor the ReadAdvice of each file within the compound file.

NOTE: it is only legal to call this method if this IndexInput has been open with ReadAdvice.NORMAL. However, this method accepts any ReadAdvice value but null as a read advice for the slice.

The default implementation delegates to .slice and ignores the ReadAdvice.