OkioSerializer

interface OkioSerializer<T>(source)

The OkioSerializer determines the on-disk format and API for accessing it.

The type T MUST be immutable. Mutable types will result in broken DataStore functionality.

Functions

Link copied to clipboard
abstract suspend fun readFrom(source: BufferedSource): T

Unmarshal object from source.

Link copied to clipboard
abstract suspend fun writeTo(t: T, sink: BufferedSink)

Marshal object to a Sink.

Properties

Link copied to clipboard
abstract val defaultValue: T

Value to return if there is no data on disk.