System.Buffers 命名空间

System.Buffers 命名空间包含用于创建和管理内存缓冲区的类型,例如由 Span<T>Memory<T> 表示的类型。 The System.Buffers namespace contains types used in creating and managing memory buffers, such as those represented by Span<T> and Memory<T>.

ArrayBufferWriter<T>

表示基于堆、使用数组的输出接收器,可向其中Represents a heap-based, array-backed output sink into which 写入数据。data can be written.

ArrayPool<T>

提供可重复使用 T[] 类型实例的资源池。Provides a resource pool that enables reusing instances of type T[].

BuffersExtensions

ReadOnlySequence<T> 提供扩展方法。Provides extension methods for ReadOnlySequence<T>.

MemoryManager<T>

用于替换 Memory<T> 实现的抽象基类。An abstract base class that is used to replace the implementation of Memory<T>.

MemoryPool<T>

表示内存块的池。Represents a pool of memory blocks.

ReadOnlySequenceSegment<T>

表示 ReadOnlyMemory<T> 节点的链接列表。Represents a linked list of ReadOnlyMemory<T> nodes.

SequenceReaderExtensions

SequenceReader<T> 类提供扩展功能,允许从二进制数据读取字节序特定数值。Provides extended functionality for the SequenceReader<T> class that allows reading of endian specific numeric values from binary data.

结构

MemoryHandle

为内存块提供一个内存句柄。Provides a memory handle for a block of memory.

ReadOnlySequence<T>.Enumerator

表示 ReadOnlySequence<T> 中的枚举器。Represents an enumerator over a ReadOnlySequence<T>.

ReadOnlySequence<T>

表示可读取 T 有序系列的序列。Represents a sequence that can read a sequential series of T.

SequenceReader<T>

提供从 ReadOnlySequence<T> 读取二进制数据和文本数据的方法,重点关注性能和最小或零堆分配。Provides methods for reading binary and text data out of a ReadOnlySequence<T> with a focus on performance and minimal or zero heap allocations.

StandardFormat

表示不使用实际字符串的标准格式字符串。Represents a standard format string without using an actual string.

接口

IBufferWriter<T>

表示可以向其中写入 T 数据的输出接收器。Represents an output sink into which T data can be written.

IMemoryOwner<T>

标识负责适当地释放基础内存的内存块所有者。Identifies the owner of a block of memory who is responsible for disposing of the underlying memory appropriately.

IPinnable

提供用于固定和取消固定对象的一个机制,以防止垃圾回收器移动这些对象。Provides a mechanism for pinning and unpinning objects to prevent the garbage collector from moving them.

枚举

OperationStatus

定义可以从基于范围的操作返回的值,这些操作支持处理多个不连续缓冲区中包含的输入。Defines the values that can be returned from span-based operations that support processing of input contained in multiple discontiguous buffers.

委托

ReadOnlySpanAction<T,TArg>

封装一个方法,该方法接收 T 类型对象的只读范围和 TArg 类型的状态对象。Encapsulates a method that receives a read-only span of objects of type T and a state object of type TArg.

SpanAction<T,TArg>

封装一个方法,该方法接收 T 类型的对象范围和 TArg 类型的状态对象。Encapsulates a method that receives a span of objects of type T and a state object of type TArg.