decode

fun <E> ProtoAdapter<E>.decode(data: <Error class: unknown class>): E

Read an encoded message from data.

Note: this method is marked with ExperimentalUnsignedTypes annotation and requires an opt-in (e.g. through @OptIn(ExperimentalUnsignedTypes::class) to be used.

Throws

if data.length is larger than Int.MAX_VALUE.