takeWhile

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

Returns a list containing first elements satisfying the given predicate.