random

inline fun ByteBuffer.random(): Byte
inline fun ShortBuffer.random(): Short
inline fun IntBuffer.random(): Int
inline fun LongBuffer.random(): Long
inline fun FloatBuffer.random(): Float
inline fun DoubleBuffer.random(): Double
inline fun CharBuffer.random(): Char

Returns a random element from this array.

Throws

if this array is empty.

fun ByteBuffer.random(random: Random): Byte
fun ShortBuffer.random(random: Random): Short
fun IntBuffer.random(random: Random): Int
fun LongBuffer.random(random: Random): Long
fun FloatBuffer.random(random: Random): Float
fun DoubleBuffer.random(random: Random): Double
fun CharBuffer.random(random: Random): Char

Returns a random element from this array using the specified source of randomness.

Throws

if this array is empty.