Table of Contents

Class NatsBufferWriter<T>

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll

Represents a heap-based, array-backed output sink into which T data can be written.

public sealed class NatsBufferWriter<T> : IBufferWriter<T>, IMemoryOwner<T>, IDisposable

Type Parameters

T

The type of items to write to the current instance.

Inheritance
NatsBufferWriter<T>
Implements
Inherited Members

Constructors

NatsBufferWriter()

Initializes a new instance of the NatsBufferWriter<T> class.

NatsBufferWriter(ArrayPool<T>)

Initializes a new instance of the NatsBufferWriter<T> class.

NatsBufferWriter(ArrayPool<T>, int)

Initializes a new instance of the NatsBufferWriter<T> class.

NatsBufferWriter(int)

Initializes a new instance of the NatsBufferWriter<T> class.

Properties

Capacity

Gets the total amount of space within the underlying buffer.

FreeCapacity

Gets the amount of space available that can still be written into without forcing the underlying buffer to grow.

WrittenCount

Gets the amount of data written to the underlying buffer so far.

WrittenMemory

Gets the data written to the underlying buffer so far, as a ReadOnlyMemory<T>.

WrittenSpan

Gets the data written to the underlying buffer so far, as a ReadOnlySpan<T>.

Methods

Advance(int)
Clear()

Clears the data written to the underlying buffer.

DangerousGetArray()

Gets an ArraySegment<T> instance wrapping the underlying T array in use.

Dispose()
GetMemory(int)
GetSpan(int)
ToString()