All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.huanshankeji.kotlinx.serialization.protobuf.NothingWorkaround.kt Maven / Gradle / Ivy

The newest version!
package com.huanshankeji.kotlinx.serialization.protobuf

import com.huanshankeji.kotlinx.serialization.NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE
import com.huanshankeji.kotlinx.serialization.serializerNothingWorkaround
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.protobuf.ProtoBuf

@Deprecated(
    NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE, ReplaceWith(
        "this.encodeToByteArray(value)",
        "kotlinx.serialization.encodeToByteArray"
    )
)
@ExperimentalSerializationApi
inline fun  ProtoBuf.encodeToByteArrayNothingWorkaround(value: T) =
    @Suppress("DEPRECATION")
    encodeToByteArray(serializerNothingWorkaround(), value)

@Deprecated(
    NOTHING_SUPPORTED_BY_KOTLINX_SERIALIZATION_MESSAGE, ReplaceWith(
        "this.decodeFromByteArray(bytes)",
        "kotlinx.serialization.decodeFromByteArray"
    )
)
@ExperimentalSerializationApi
inline fun  ProtoBuf.decodeFromByteArrayNothingWorkaround(bytes: ByteArray) =
    @Suppress("DEPRECATION")
    decodeFromByteArray(serializerNothingWorkaround(), bytes)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy