# JournalBufferWriter

Package: [Microsoft.Orleans.Journaling](/orleans/docs/api/csharp/microsoft.orleans.journaling/) 10.0.0-alpha.1

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Journaling) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Journaling/JournalBufferWriter.cs#L18)

```csharp
public abstract class JournalBufferWriter : IBufferWriter<byte>, IDisposable
```

Base class for in-memory journal buffers used to assemble a pending journal batch.

## Remarks

Derived classes own physical entry framing. This base class owns the buffer and committed-length watermark so that callers can flush a committed prefix while another entry is being written. Buffers returned by [JournalBufferWriter](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.journalbufferwriter/) are pinned, caller-owned snapshots which must remain valid for the caller's lifetime even if [JournalBufferWriter](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.journalbufferwriter/) or [JournalBufferWriter](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.journalbufferwriter/) is called before the caller disposes the returned buffer. Despite the name, this type does not perform storage I/O; it accumulates encoded journal entries until callers hand the buffer off to [IJournalStorage](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.ijournalstorage/).

## Methods

- [CreateJournalStreamWriter(JournalStreamId)](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.journalbufferwriter/methods/createjournalstreamwriter-orleans-journaling-journalstreamid-d8e83036/)
- [Dispose](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.journalbufferwriter/methods/dispose-28fa9508/)
- [GetBuffer](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.journalbufferwriter/methods/getbuffer-95f722b3/)
- [Reset](/orleans/docs/api/csharp/microsoft.orleans.journaling/orleans.journaling.journalbufferwriter/methods/reset-0c0aff32/)
