Skip to content

Namespace DotBoxD.Services.Buffers

Payload

A single-owner buffer rented from System.Buffers.ArrayPool. Dispose returns the backing array to the pool exactly once. Treat DotBoxD.Services.Buffers.Payload.Memory as read-only after the buffer has been handed off (it is mutable only to support the receive fill path and the System.Buffers.IMemoryOwner contract).

PooledBufferWriter

An System.Buffers.IBufferWriter backed by an array rented from System.Buffers.ArrayPool. Either hand the written bytes off via DotBoxD.Services.Buffers.PooledBufferWriter.DetachPayload or release them via DotBoxD.Services.Buffers.PooledBufferWriter.Dispose — never both.