FileCodec

inline fun <T : @Serializable Any> FileCodec(file: Path, tempFile: Path = uniqueTempFile(file), json: Json = DefaultJson): FileCodec<T>

Creates a store with FileCodec with json serializer

Return

store that contains a value of type T

Parameters

file

path to the file that is managed by this store

tempFile

staging file this codec writes through. Defaults to a path unique to this codec, so that codecs sharing a file never stage into the same buffer - see uniqueTempFile

json

JSON Serializer to use. defaults to DefaultJson