Edit

ArcBufferWriter Class

Definition

A IBufferWriter<T> implementation implemented using pooled arrays which is specialized for creating ReadOnlySequence<T> instances.

[Orleans.Immutable]
public sealed class ArcBufferWriter : IDisposable, System.Buffers.IBufferWriter<byte>
[<Orleans.Immutable>]
type ArcBufferWriter = class
    interface IBufferWriter<byte>
    interface IDisposable
Public NotInheritable Class ArcBufferWriter
Implements IBufferWriter(Of Byte), IDisposable
Inheritance
ArcBufferWriter
Attributes
Implements

Constructors

Name Description
ArcBufferWriter()

Initializes a new instance of the ArcBufferWriter struct.

Fields

Name Description
MinimumPageSize

Gets the minimum page size.

Properties

Name Description
Length

Gets the number of unconsumed bytes.

Methods

Name Description
AdvanceReader(Int32)

Advances the reader by the specified number of bytes.

AdvanceWriter(Int32)

Advances the writer by the specified number of bytes.

ConsumeSlice(Int32)

Consumes a slice of the provided length.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetMemory(Int32)

Returns a Memory<T> to write to that is at least the requested size (specified by sizeHint).

GetSpan(Int32)

Returns a Span<T> to write to that is at least the requested size (specified by sizeHint).

Peek(Span<Byte>)

Copies the contents of this writer to a span.

Peek(Span<Byte>)

Attempts to read the provided number of bytes from the buffer.

PeekSlice(Int32)

Returns a slice of the provided length without marking the data referred to it as consumed.

ReplenishBuffers(List<ArraySegment<Byte>>)

Adds additional buffers to the destination list until the list has reached its capacity.

Reset()

Resets this instance, returning all memory.

Write(ReadOnlySequence<Byte>)

Writes the provided sequence to this buffer.

Write(ReadOnlySpan<Byte>)

Writes the provided value to this buffer.

Explicit Interface Implementations

Name Description
IBufferWriter<Byte>.Advance(Int32)

Notifies the IBufferWriter<T> that count data items were written to the output Span<T> or Memory<T>.

Applies to