SparseBufferWriter<T>
public class SparseBufferWriter<T> : Disposable, IEnumerable<ReadOnlyMemory<T>>, IEnumerable, IGrowableBuffer<T>, IReadOnlySpanConsumer<T>, ISupplier<ReadOnlyMemory<T>, CancellationToken, ValueTask>, IDisposable, ISupplier<ReadOnlySequence<T>>, IBufferWriter<T>
Represents builder of the sparse memory buffer.
Represents enumerator over memory segments.
Gets the number of written elements.
public SparseBufferWriter(int chunkSize, SparseBufferGrowth growth = 0, MemoryAllocator<T> allocator = null)
Initializes a new builder with the specified size of memory block.
Initializes a new builder with automatically selected
chunk size.
public SparseBufferWriter()
Initializes a new builder which uses Shared
as a default allocator of buffers.
Clears internal buffers so this builder can be reused.
Passes the contents of this builder to the consumer.
Passes the contents of this builder to the callback.
Copies the contents of this builder to the specified memory block.
Gets enumerator over memory segments.
Writes the block of memory to this builder.
Writes the block of memory to this builder.
Writes a sequence of memory blocks to this builder.