kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

Add support for unsigned numbers arrays

Open osipxd opened this issue 3 years ago • 2 comments

What is your use-case and why do you need this feature?

Use-cases for U[X]Array, are similar as for [X]Array.

Describe the solution you'd like

Add serializers for UByteArray, UShortArray, UIntArray and ULongArray.

val bytes = Json.decodeFromString<UByteArray>("[0, 127, 255]")
prtintln(bytes.contentToString()) // [0, 127, 255]

osipxd avatar Jul 13 '22 08:07 osipxd

I can try to implement this feature myself if it is needed

osipxd avatar Jul 13 '22 08:07 osipxd

@osipxd, thanks for the offer, but this improvement requires changing not only the serialization runtime, but also the plugin. The feature will be available after several Kotlin releases.

shanshin avatar Jul 14 '22 20:07 shanshin