setBytesRef

fun setBytesRef(builder: BytesRefBuilder, result: BytesRef, offset: Long, length: Int)

Fill the provided BytesRef with the bytes at the specified offset and length. This will avoid copying the bytes if the slice fits into a single block; otherwise, it uses the provided BytesRefBuilder to copy bytes over.