Class SequenceBuilder<T>
Represents builder of non-contiguous memory buffer.
Implements
Inherited Members
Namespace: DotNext.Buffers
Assembly: DotNext.IO.dll
Syntax
public class SequenceBuilder<T> : SparseBufferWriter<T>, IGrowableBuffer<T>, IReadOnlySpanConsumer<T>, ISupplier<ReadOnlyMemory<T>, CancellationToken, ValueTask>, IFunctional<Func<ReadOnlyMemory<T>, CancellationToken, ValueTask>>, IResettable, IEnumerable<ReadOnlyMemory<T>>, IEnumerable, IBufferWriter<T>, IReadOnlySequenceSource<T>, IDisposable, ISupplier<ReadOnlySequence<T>>, IFunctional<Func<ReadOnlySequence<T>>>
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the memory. |
Constructors
| Edit this page View SourceSequenceBuilder()
Initializes a new builder which uses Shared as a default allocator of buffers.
Declaration
public SequenceBuilder()
SequenceBuilder(MemoryPool<T>)
Initializes a new builder with automatically selected chunk size.
Declaration
public SequenceBuilder(MemoryPool<T> pool)
Parameters
Type | Name | Description |
---|---|---|
MemoryPool<T> | pool | Memory pool used to allocate memory chunks. |
SequenceBuilder(int, MemoryAllocator<T>?)
Initializes a new builder with the specified size of memory block.
Declaration
public SequenceBuilder(int chunkSize, MemoryAllocator<T>? allocator = null)
Parameters
Type | Name | Description |
---|---|---|
int | chunkSize | The size of the memory block representing single segment within sequence. |
MemoryAllocator<T> | allocator | The allocator used to rent the segments. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|