startsWith

fun ByteBuffer.startsWith(prefix: ByteArray, prefixSkip: Int = 0): Boolean
fun ByteBuffer.startsWith(prefix: ByteBuffer, prefixSkip: Int = 0): Boolean

Whether the ByteBuffer starts with a ByteArray from the current position.


Whether the ByteBuffer starts with a String from the current position.


Whether the ByteBuffer starts with a list of ByteBuffer from the current position.

Return

Pair of Boolean (whether the ByteBuffer start with the prefix) and Int that is the index of the prefix found (-1 if not found).

Parameters

prefixes