ProtoBufFormat

class ProtoBufFormat<T>(serializer: KSerializer<T>) : BodyFormat<T>

A BodyFormat that uses ProtoBufSerializer to encode and decode values.

Constructors

Link copied to clipboard
constructor(serializer: KSerializer<T>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val contentType: String

The content type of the body.

Link copied to clipboard

The serialization engine that produced this format, if any.

Functions

Link copied to clipboard
open override fun decode(bytes: ByteArray, contentType: String): T

Decodes the byte array into the type T.

Link copied to clipboard
open override fun encode(value: T): ByteArray

Encodes the value into a byte array for transmission.