Прочитај на енглеском Уреди

Делите путем


ArrayPoolBufferWriter<T> Class

Definition

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

C#
public sealed class ArrayPoolBufferWriter<T> : IDisposable, Microsoft.Toolkit.HighPerformance.Buffers.IBuffer<T>, System.Buffers.IBufferWriter<T>, System.Buffers.IMemoryOwner<T>
C#
public sealed class ArrayPoolBufferWriter<T> : Microsoft.Toolkit.HighPerformance.Buffers.IBuffer<T>, System.Buffers.IBufferWriter<T>, System.Buffers.IMemoryOwner<T>

Type Parameters

T

The type of items to write to the current instance.

Inheritance
ArrayPoolBufferWriter<T>
Implements

Remarks

This is a custom IBufferWriter<T> implementation that replicates the functionality and API surface of the array-based buffer writer available in .NET Standard 2.1, with the main difference being the fact that in this case the arrays in use are rented from the shared ArrayPool<T> instance, and that ArrayPoolBufferWriter<T> is also available on .NET Standard 2.0.

Constructors

ArrayPoolBufferWriter<T>()

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

ArrayPoolBufferWriter<T>(ArrayPool<T>, Int32)

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

ArrayPoolBufferWriter<T>(ArrayPool<T>)

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

ArrayPoolBufferWriter<T>(Int32)

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

Properties

Methods

Advance(Int32)
Clear()
Dispose()

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

Finalize()

Finalizes an instance of the ArrayPoolBufferWriter<T> class.

GetMemory(Int32)
GetSpan(Int32)
ToString()

Returns a string that represents the current object.

Explicit Interface Implementations

Extension Methods

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

Writes a value of a specified type into a target IBufferWriter<T> instance.

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

Writes a value of a specified type into a target IBufferWriter<T> instance.

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

Writes a value of a specified type into a target IBufferWriter<T> instance.

Applies to

Производ Верзије
Windows Community Toolkit 6.1.1, 7.0.0, 7.1.0