encode

open suspend override fun encode(value: T?)

Encodes the given value to the file, along with the current version. If the value is null, both files are deleted. If the encoding fails, the temp files are deleted. On platforms where atomic move is not supported (e.g., Android 7 and below) this falls back to a non-atomic copy-and-delete; the transactional guarantee does not hold for that fallback path.

Parameters

value

optional value to encode