suspend fun read(min: Int = 1, consumer: (ByteBuffer) -> Unit)
I'm trying to implement a usage of this function but I'm getting type mismatch error
Required: (ByteBuffer) -> Unit
Found: ByteBuffer!
Can someone give me an example or link to a code that uses (Int/String/Any) -> Unit ?
otakusenpai
10/10/2018, 8:45 PM
I'm ashamed to ask for this but my lambda experience is bad
s
serebit
10/10/2018, 8:47 PM
You’re passing a ByteBuffer to the function when you should be passing a function that consumes a ByteBuffer, like so: