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 a value indicating that this buffer consists of a single segment.
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.
Adds a single item to the buffer.
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.
Attempts to get the underlying buffer if it is presented by a single segment.
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.