# WriteScope

Artifact: [androidx.datastore:datastore-core](https://developer.android.com/jetpack/androidx/releases/datastore) [View Source](https://cs.android.com/search?q=file:androidx/datastore/core/StorageConnection.kt+class:androidx.datastore.core.WriteScope) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/datastore#1.1.0)

*** ** * ** ***


```
public interface WriteScope<T extends Object> extends ReadScope<@NonNull T>
```

<br />

*** ** * ** ***

The scope used for a write transaction.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/datastore/core/WriteScope#writeData(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull T value)` Writes the data to the underlying storage. |

### Inherited methods

From [androidx.datastore.core.Closeable](https://developer.android.com/reference/androidx/datastore/core/Closeable) `abstract void` `https://developer.android.com/reference/androidx/datastore/core/Closeable#close()()`

Closes the specified resource.
From [androidx.datastore.core.ReadScope](https://developer.android.com/reference/androidx/datastore/core/ReadScope) `abstract @https://developer.android.com/reference/androidx/annotation/NonNull T` `https://developer.android.com/reference/androidx/datastore/core/ReadScope#readData()()`

Read the data from the underlying storage.

## Public methods

### writeData

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/datastore#1.1.0)

```
abstract void writeData(@NonNull T value)
```

Writes the data to the underlying storage.