JavaSerializableSerializer



A serializer for java.io.Serializable. This serializer uses SavedState's API directly to save/load a java.io.Serializable.

Note that this serializer should be used with SavedStateEncoder or SavedStateDecoder only. Using it with other Encoders/Decoders may throw IllegalArgumentException.

import androidx.savedstate.serialization.serializers.JavaSerializableSerializer

@Serializable
data class MyModel(
    @Serializable(with = JavaSerializableSerializer::class)
    val serializable: java.io.Serializable
)

Summary

Public constructors

android

Public functions

final T
deserialize(decoder: Decoder)
android
final Unit
serialize(encoder: Encoder, value: T)
android

Public properties

final SerialDescriptor
android

Public constructors

JavaSerializableSerializer

<T : Serializable> JavaSerializableSerializer()

Public functions

deserialize

final fun deserialize(decoder: Decoder): T

serialize

final fun serialize(encoder: Encoder, value: T): Unit

Public properties

descriptor

final val descriptorSerialDescriptor