# VolatileJournalStorage.ReplaceAsync(ReadOnlySequence&lt;byte&gt;, CancellationToken)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.volatilejournalstorage/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.volatilejournalstorage/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Journaling/VolatileJournalStorage.cs#L250-L260)

```csharp
public ValueTask ReplaceAsync(ReadOnlySequence<byte> snapshot, CancellationToken cancellationToken)
```

Replaces the journal with the provided value atomically.

### Parameters

- `snapshot` (`ReadOnlySequence<byte>`): The encoded journal bytes to write. The storage provider must not retain this buffer after the returned task completes.
- `cancellationToken` (`CancellationToken`): The cancellation token.

### Returns

A `System.Threading.Tasks.ValueTask` representing the operation.
