@@ -52,7 +52,7 @@ dependencies {
5252 // For serialization support
5353 implementation(" org.jetbrains.kotlinx:kotlinx-serialization-core:1.9.0" )
5454}
55- ````
55+ ```
5656
5757You also need to load the serialization plugin.
5858
@@ -71,7 +71,7 @@ data class Payload(
7171 @VarInt
7272 val delta : Int , // zig-zag + varint
7373
74- val urgent : Boolean , // joined to bitset
74+ val urgent : Boolean , // joined to bitset
7575 val sensitive : Boolean ,
7676 val external : Boolean ,
7777 val handled : Instant ? , // nullable, tracked via bitset
@@ -126,7 +126,6 @@ Decoding is symmetric:
126126
127127``` kotlin
128128val back = Base62 .decode(" 2BVj6VHhfNlsGmoMQF" )
129- assert (back.contentEquals(bytes))
130129```
131130
132131---
@@ -137,7 +136,6 @@ For more complex payloads (nested types, lists, maps) use `ProtoBuf` as the
137136binary format and still get compact, ASCII-safe strings:
138137
139138``` kotlin
140-
141139@Serializable
142140data class ProtoBufRequired (val map : Map <String , Int >)
143141
@@ -155,6 +153,10 @@ val decoded = format.decodeFromString<ProtoBufRequired>(encoded)
155153assert (decoded == payload)
156154```
157155
156+ This example relies on kotlinx protobuf implementation:
157+ ``` kotlin implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.9.0")
158+ ````
159+
158160-- -
159161
160162## Encryption
0 commit comments