Redigera

Dela via


ArrayBufferWriter<T> Class

Definition

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

generic <typename T>
public ref class ArrayBufferWriter sealed : System::Buffers::IBufferWriter<T>
public sealed class ArrayBufferWriter<T> : System.Buffers.IBufferWriter<T>
type ArrayBufferWriter<'T> = class
    interface IBufferWriter<'T>
Public NotInheritable Class ArrayBufferWriter(Of T)
Implements IBufferWriter(Of T)

Type Parameters

T

The type of the items in this ArrayBufferWriter<T> instance.

Inheritance
ArrayBufferWriter<T>
Implements

Constructors

ArrayBufferWriter<T>()

Creates an instance of an ArrayBufferWriter<T> to which data can be written, with the default initial capacity.

ArrayBufferWriter<T>(Int32)

Creates an instance of an ArrayBufferWriter<T> to which data can be written, with a specified initial capacity.

Properties

Capacity

Gets the total amount of space within the underlying buffer.

FreeCapacity

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

WrittenCount

Gets the amount of data written to the underlying buffer.

WrittenMemory

Gets a ReadOnlyMemory<T> that contains the data written to the underlying buffer so far.

WrittenSpan

Gets a ReadOnlySpan<T> that contains the data written to the underlying buffer so far.

Methods

Advance(Int32)

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

Clear()

Clears the data written to the underlying buffer.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetMemory(Int32)

Returns a Memory<T> to write to that is at least the length specified by sizeHint.

GetSpan(Int32)

Returns a Span<T> to write to that is at least a specified length.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ResetWrittenCount()
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Extension Methods

Write<T>(IBufferWriter<T>, ReadOnlySpan<T>)

Writes the contents of value to writer.

Applies to