copyOfRange

fun ByteBuffer.copyOfRange(fromIndex: Int, toIndex: Int): ByteBuffer
fun ShortBuffer.copyOfRange(fromIndex: Int, toIndex: Int): ShortBuffer
fun IntBuffer.copyOfRange(fromIndex: Int, toIndex: Int): IntBuffer
fun LongBuffer.copyOfRange(fromIndex: Int, toIndex: Int): LongBuffer
fun FloatBuffer.copyOfRange(fromIndex: Int, toIndex: Int): FloatBuffer
fun DoubleBuffer.copyOfRange(fromIndex: Int, toIndex: Int): DoubleBuffer
fun CharBuffer.copyOfRange(fromIndex: Int, toIndex: Int): CharBuffer

Returns a new array which is a copy of the specified range of the original array.

Parameters

fromIndex

the start of the range (inclusive) to copy.

toIndex

the end of the range (exclusive) to copy.

Throws

if fromIndex is less than zero or toIndex is greater than the size of this array.

if fromIndex is greater than toIndex.