maxWithOrNull

fun ByteBuffer.maxWithOrNull(comparator: Comparator<in Byte>): Byte?
fun ShortBuffer.maxWithOrNull(comparator: Comparator<in Short>): Short?
fun IntBuffer.maxWithOrNull(comparator: Comparator<in Int>): Int?
fun LongBuffer.maxWithOrNull(comparator: Comparator<in Long>): Long?
fun FloatBuffer.maxWithOrNull(comparator: Comparator<in Float>): Float?
fun DoubleBuffer.maxWithOrNull(comparator: Comparator<in Double>): Double?
fun CharBuffer.maxWithOrNull(comparator: Comparator<in Char>): Char?

Returns the first element having the largest value according to the provided comparator or null if there are no elements.