# JournalBufferWriter

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

[Source](https://github.com/dotnet/orleans/blob/6a0e937f544c35ffcf11b37e4c2b7de5a1580a03/src/Orleans.Durable/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.durable/orleans.durable.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.durable/orleans.durable.journaling.journalbufferwriter/) or [JournalBufferWriter](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.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.durable/orleans.durable.journaling.ijournalstorage/).

## Constructors

- [JournalBufferWriter](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/constructors/constructor-bb4e7140/)

## Properties

- [ActiveEntryLength](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/properties/activeentrylength-4c97afe2/)
- [Output](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/properties/output-d2a73e04/)

## Methods

- [CreateJournalStreamWriter(JournalStreamId)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/createjournalstreamwriter-orleans-durable-journaling-journalstreamid-d8e83036/)
- [Dispose](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/dispose-28fa9508/)
- [FinishEntry(JournalStreamId)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/finishentry-orleans-durable-journaling-journalstreamid-bbd9c12a/)
- [GetBuffer](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/getbuffer-95f722b3/)
- [GetEntryByte(int)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/getentrybyte-int-e620e4fa/)
- [Reset](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/reset-0c0aff32/)
- [StartEntry(JournalStreamId)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/startentry-orleans-durable-journaling-journalstreamid-e6318a4a/)
- [WriteAt(int, ReadOnlySpan&lt;byte&gt;)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/writeat-int-system-readonlyspan-byte-1c2288b1/)
- [WritePreservedEntry(JournalStreamId, IPreservedJournalEntry)](/orleans/docs/api/csharp/microsoft.orleans.durable/orleans.durable.journaling.journalbufferwriter/methods/writepreservedentry-orleans-durable-journaling-journalstreamid-orleans-durable-j-0a594f59/)
