maxOfWith

inline fun <R> ByteBuffer.maxOfWith(comparator: Comparator<in R>, selector: (Byte) -> R): R
inline fun <R> ShortBuffer.maxOfWith(comparator: Comparator<in R>, selector: (Short) -> R): R
inline fun <R> IntBuffer.maxOfWith(comparator: Comparator<in R>, selector: (Int) -> R): R
inline fun <R> LongBuffer.maxOfWith(comparator: Comparator<in R>, selector: (Long) -> R): R
inline fun <R> FloatBuffer.maxOfWith(comparator: Comparator<in R>, selector: (Float) -> R): R
inline fun <R> DoubleBuffer.maxOfWith(comparator: Comparator<in R>, selector: (Double) -> R): R
inline fun <R> CharBuffer.maxOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R

Returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the array.

Throws

if the array is empty.