otakusenpai
10/10/2018, 8:45 PMsuspend 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 PMserebit
10/10/2018, 8:47 PMread { buffer: ByteBuffer ->
println(buffer.readRemaining())
}
I doubt that’ll compile, but it’s the correct syntax.