first

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

Returns first element.

Throws

if the buffer is empty.

inline fun ByteBuffer.first(predicate: (Byte) -> Boolean): Byte
inline fun ShortBuffer.first(predicate: (Short) -> Boolean): Short
inline fun IntBuffer.first(predicate: (Int) -> Boolean): Int
inline fun LongBuffer.first(predicate: (Long) -> Boolean): Long
inline fun FloatBuffer.first(predicate: (Float) -> Boolean): Float
inline fun DoubleBuffer.first(predicate: (Double) -> Boolean): Double
inline fun CharBuffer.first(predicate: (Char) -> Boolean): Char

Returns the first element matching the given predicate.

Throws

if no such element is found.