Kotlin Integration#
Requirements#
- JDK 17 or later
- Kotlin 2.0 or later
Installation#
Features#
Factory methods#
The Kotlin API's factory methods mirror the Java API's factory methods but use named arguments with default values instead of option builders.
For example, BufferAllocators.ofPooled()
(note the plural form)
mirrors BufferAllocator.ofPooled()
.
Extension methods#
Read unsigned integers#
fun read(reader: MessageReader) {
val num1: UByte = reader.readUByteKotlin()
val num2: UShort = reader.readUShortKotlin()
var num3: UInt = reader.readUIntKotlin()
var num4: ULong = reader.readULongKotlin()
}