public interface Storage<T extends Object>

Known direct subclasses
FileStorage

The Java IO File version of the Storage interface.

OkioStorage

OKIO implementation of the Storage interface, providing cross platform IO using the OKIO library.


Storage provides a way to create StorageConnections that allow read and write a particular type of data. Storage is used to construct DataStore objects, and encapsulates all the specifics of the data format and persistence.

Implementers provide the specifics of how and where the data is stored.

Summary

Public methods

abstract @NonNull StorageConnection<@NonNull T>

Creates a storage connection which allows reading and writing to the underlying storage.

Public methods

createConnection

Added in 1.1.1
abstract @NonNull StorageConnection<@NonNull T> createConnection()

Creates a storage connection which allows reading and writing to the underlying storage.

Should be closed after usage.

Throws
androidx.datastore.core.IOException

Unrecoverable IO exception when trying to access the underlying storage.