IBufferAsBase64Serializer

object IBufferAsBase64Serializer : KSerializer<ByteArray>

A kotlinx.serialization KSerializer that represents a ByteArray as a Base64 string instead of the default array-of-bytes form.

Apply it to a binary property with @Serializable(with = IBufferAsBase64Serializer::class) to keep that field compact and human-readable in text formats such as JSON. Encoding uses the standard Base64 alphabet (RFC 4648), consistent with encodeBase64 and decodeBase64.

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

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