ByteArrayAsBase64Serializer
A custom serializer for serializing and deserializing ByteArray
objects as Base64-encoded strings.
Uses the Base64.Default
encoding and decoding mechanisms from the kotlinx-serialization library to transform ByteArray
values into readable Base64 string representation during serialization and to decode Base64 strings back into byte arrays during deserialization.
The underlying serialized form is described as a primitive value of kind STRING
.
This serializer is particularly useful when working with data that needs to be encoded as Base64 in JSON or other text-based serialization formats.