Table of Contents

Interface ICsvBufferWriter<T>

Namespace
FlameCsv.IO
Assembly
FlameCsv.Core.dll

Buffer writer interface for writing CSV data.

[EditorBrowsable(EditorBrowsableState.Advanced)]
public interface ICsvBufferWriter<T> : IBufferWriter<T> where T : unmanaged

Type Parameters

T
Inherited Members

Remarks

This interface extends IBufferWriter<T> to provide additional functionality to flush and complete the writer.

Properties

BufferPool

Gets the buffer pool used by the writer.

IBufferPool BufferPool { get; }

Property Value

IBufferPool

NeedsDrain

Whether the writer should be drained to prevent resizing internal buffers.

bool NeedsDrain { get; }

Property Value

bool

Methods

Complete(Exception?)

Completes the writer, draining unflushed data and flushing the underlying target if exception is null.

void Complete(Exception? exception)

Parameters

exception Exception

Exception observed when writing the data. If not null, pending data may not be flushed.

CompleteAsync(Exception?, CancellationToken)

Asynchronously completes the writer, draining unflushed data and flushing the underlying target if exception is null.

ValueTask CompleteAsync(Exception? exception, CancellationToken cancellationToken = default)

Parameters

exception Exception

Exception observed when writing the data. If not null, pending data may not be flushed.

cancellationToken CancellationToken

Cancellation token to cancel the flushing operation if applicable

Returns

ValueTask

A task representing the completion operation

Drain()

Drains the writer, ensuring that the buffered data is written to the underlying target.
May be a no-op, for example when writing to a StringBuilder or an inner IBufferWriter<T>.

void Drain()

DrainAsync(CancellationToken)

Asynchronously drains the writer, ensuring that the buffered data is written to the underlying target.
May be a no-op, for example when writing to a StringBuilder or an inner IBufferWriter<T>.

ValueTask DrainAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token to cancel the flush operation

Returns

ValueTask

A task representing the flush operation