Interface ICsvBufferWriter<T>
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
NeedsFlush
Whether the writer should be flushed to prevent resizing internal buffers.
bool NeedsFlush { get; }
Property Value
Methods
Complete(Exception?)
Completes the reader, flushing unflushed data if exception
is null.
void Complete(Exception? exception)
Parameters
exception
ExceptionException observed when writing the data. If not null, pending unflushed data does not get flushed.
CompleteAsync(Exception?, CancellationToken)
Asynchronously completes the writer, flushing unflushed data if exception
is null.
ValueTask CompleteAsync(Exception? exception, CancellationToken cancellationToken = default)
Parameters
exception
ExceptionException observed when writing the data. If not null, pending unflushed data does not get flushed.
cancellationToken
CancellationTokenCancellation token to cancel the flushing operation if applicable
Returns
- ValueTask
A task representing the completion operation
Flush()
Flushes the writer, ensuring that the written data is transported to the underlying target.
void Flush()
FlushAsync(CancellationToken)
Asynchronously flushes the writer, ensuring that the written data is transported to the underlying target.
ValueTask FlushAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation token to cancel the flush operation
Returns
- ValueTask
A task representing the flush operation