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.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

The serial descriptor associated with the ByteArrayAsBase64Serializer.

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): ByteArray

Deserializes a Base64-encoded string into a ByteArray.

Link copied to clipboard
open override fun serialize(encoder: Encoder, value: ByteArray)

Serializes a ByteArray into a Base64-encoded string.