FileStorage
-
android
class FileStorage<T : Any?> : Storage
The Java IO File version of the StorageT to a given file location.
Summary
Public constructors |
|
|---|---|
<T : Any?> FileStorage( |
android
|
Public functions |
||
|---|---|---|
open StorageConnection<T> |
Creates a storage connection which allows reading and writing to the underlying storage. |
android
|
Public constructors
FileStorage
<T : Any?> FileStorage(
serializer: Serializer<T>,
coordinatorProducer: (File) -> InterProcessCoordinator = { createSingleProcessCoordinator(it) },
produceFile: () -> File
)
| Parameters | |
|---|---|
serializer: Serializer<T> |
The serializer that can write |
coordinatorProducer: (File) -> InterProcessCoordinator = {
createSingleProcessCoordinator(it)
} |
The producer to provide |
produceFile: () -> File |
The file producer that returns the file that will be read and written. |
Public functions
createConnection
open fun createConnection(): StorageConnection<T>
Creates a storage connection which allows reading and writing to the underlying storage.
Should be closed after usage.
| Throws | |
|---|---|
IOException |
Unrecoverable IO exception when trying to access the underlying storage. |