Table of Contents

Class CsvBufferReader

Namespace
FlameCsv.IO
Assembly
FlameCsv.Core.dll

Static class that can be used to create ICsvBufferReader<T> instances.

[EditorBrowsable(EditorBrowsableState.Advanced)]
public static class CsvBufferReader
Inheritance
object
CsvBufferReader

Methods

Create(in ReadOnlySequence<byte>, in CsvIOOptions)

Creates a new pipe reader over the CSV data.

public static ICsvBufferReader<byte> Create(in ReadOnlySequence<byte> csv, in CsvIOOptions options = default)

Parameters

csv ReadOnlySequence<byte>

CSV data

options CsvIOOptions

Returns

ICsvBufferReader<byte>

Create(in ReadOnlySequence<char>, in CsvIOOptions)

Creates a new pipe reader over the CSV data.

public static ICsvBufferReader<char> Create(in ReadOnlySequence<char> csv, in CsvIOOptions options = default)

Parameters

csv ReadOnlySequence<char>

CSV data

options CsvIOOptions

Returns

ICsvBufferReader<char>

Create(Stream, in CsvIOOptions)

Creates a new CSV reader instance from a Stream.

public static ICsvBufferReader<byte> Create(Stream stream, in CsvIOOptions options = default)

Parameters

stream Stream

The stream

options CsvIOOptions

Options to configure the reader

Returns

ICsvBufferReader<byte>

Remarks

If the stream is a MemoryStream, the buffer is accessed directly for zero-copy reads if possible; see DisableOptimizations.

Create(Stream, Encoding?, in CsvIOOptions)

Creates a new CSV reader instance from a Stream and an Encoding.

public static ICsvBufferReader<char> Create(Stream stream, Encoding? encoding = null, in CsvIOOptions options = default)

Parameters

stream Stream

The stream

encoding Encoding

Encoding used to read the bytes

options CsvIOOptions

Options to configure the reader

Returns

ICsvBufferReader<char>

Remarks

If encoding is null, ASCII, or UTF8, a custom reader implementation is used for more performant reading. Use the overload with TextReader if this behavior is not desired.

Create(TextReader, in CsvIOOptions)

Creates a new CSV reader instance from a TextReader.

public static ICsvBufferReader<char> Create(TextReader reader, in CsvIOOptions options = default)

Parameters

reader TextReader

The text reader

options CsvIOOptions

Options to configure the reader

Returns

ICsvBufferReader<char>

Remarks

If the stream is a StringReader, the internal string is accessed directly for zero-copy reads; see DisableOptimizations.

Create(ReadOnlyMemory<byte>)

Creates a new pipe reader over the CSV data.

public static ICsvBufferReader<byte> Create(ReadOnlyMemory<byte> csv)

Parameters

csv ReadOnlyMemory<byte>

CSV data

Returns

ICsvBufferReader<byte>

Create(ReadOnlyMemory<char>)

Creates a new pipe reader over the CSV data.

public static ICsvBufferReader<char> Create(ReadOnlyMemory<char> csv)

Parameters

csv ReadOnlyMemory<char>

CSV data

Returns

ICsvBufferReader<char>

Create(string?)

Creates a new pipe reader over the CSV data.

public static ICsvBufferReader<char> Create(string? csv)

Parameters

csv string

CSV data

Returns

ICsvBufferReader<char>

Create(StringBuilder?, in CsvIOOptions)

Creates a new reader over the CSV data.

public static ICsvBufferReader<char> Create(StringBuilder? csv, in CsvIOOptions options = default)

Parameters

csv StringBuilder

String builder containing the CSV

options CsvIOOptions

Options to configure the reader

Returns

ICsvBufferReader<char>

Remarks

The StringBuilder must not be modified while the reader is in use.

Create<T>(in ReadOnlySequence<T>, in CsvIOOptions)

Creates a new pipe reader over the CSV data.

public static ICsvBufferReader<T> Create<T>(in ReadOnlySequence<T> csv, in CsvIOOptions options = default) where T : unmanaged, IBinaryInteger<T>

Parameters

csv ReadOnlySequence<T>

CSV data

options CsvIOOptions

Returns

ICsvBufferReader<T>

Type Parameters

T

Create<T>(ReadOnlyMemory<T>)

Creates a new pipe reader over the CSV data.

public static ICsvBufferReader<T> Create<T>(ReadOnlyMemory<T> csv) where T : unmanaged, IBinaryInteger<T>

Parameters

csv ReadOnlyMemory<T>

CSV data

Returns

ICsvBufferReader<T>

Type Parameters

T