InMemoryStorage

Thread-unsafe in-memory HydratedStorage for use in unit tests.

val bloc = CounterBloc(storage = InMemoryStorage())

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun clear()

Removes all entries managed by this storage.

Link copied to clipboard
open override fun delete(key: String)

Removes the entry for key. No-op if the key does not exist.

Link copied to clipboard
open override fun read(key: String): ByteArray?

Returns the raw bytes stored under key, or null if absent.

Link copied to clipboard
open override fun write(key: String, value: ByteArray)

Persists value under key, overwriting any previous entry.