Class SequenceBuilder<T>
Represents builder of non-contiguous memory buffer.
Namespace: DotNext.Buffers
Assembly: DotNext.IO.dll
Syntax
public class SequenceBuilder<T> : SparseBufferWriter<T>, IReadOnlySequenceSource<T>, IDisposable, IConvertible<ReadOnlySequence<T>>
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the memory. |
Constructors
| Improve this Doc 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(Int32, Nullable<MemoryAllocator<T>>)
Initializes a new builder with the specified size of memory block.
Declaration
public SequenceBuilder(int chunkSize, MemoryAllocator<T>? allocator = default(MemoryAllocator<T>? ))
Parameters
Type | Name | Description |
---|---|---|
Int32 | chunkSize | The size of the memory block representing single segment within sequence. |
Nullable<MemoryAllocator<T>> | allocator | The allocator used to rent the segments. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Explicit Interface Implementations
| Improve this Doc View SourceIReadOnlySequenceSource<T>.Sequence
Declaration
ReadOnlySequence<T> IReadOnlySequenceSource<T>.Sequence { get; }
Returns
Type | Description |
---|---|
ReadOnlySequence<T> |
Implements
System.IConvertible<>