getLong

abstract suspend fun getLong(key: String, defValue: Long): Long

Reads the Long value stored under key, returning defValue if absent.

Return

The stored long, or defValue.

Parameters

key

Storage key to look up.

defValue

Value returned when key is not found.

Throws

if the stored value cannot be read or cast to Long.

for any other storage-layer error.

CancellationException

if the calling coroutine is cancelled.