Class CsvBufferReader
Static class that can be used to create ICsvBufferReader<T> instances.
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static class CsvBufferReader
- Inheritance
-
CsvBufferReader
Methods
Create(in ReadOnlySequence<byte>, MemoryPool<byte>?, CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<byte> Create(in ReadOnlySequence<byte> csv, MemoryPool<byte>? memoryPool = null, CsvIOOptions options = default)
Parameters
csv
ReadOnlySequence<byte>CSV data
memoryPool
MemoryPool<byte>options
CsvIOOptions
Returns
Create(in ReadOnlySequence<char>, MemoryPool<char>?, CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<char> Create(in ReadOnlySequence<char> csv, MemoryPool<char>? memoryPool = null, CsvIOOptions options = default)
Parameters
csv
ReadOnlySequence<char>CSV data
memoryPool
MemoryPool<char>options
CsvIOOptions
Returns
Create(Stream, MemoryPool<byte>?, CsvIOOptions)
Creates a new CSV reader instance from a Stream.
public static ICsvBufferReader<byte> Create(Stream stream, MemoryPool<byte>? memoryPool = null, CsvIOOptions options = default)
Parameters
stream
StreamThe stream
memoryPool
MemoryPool<byte>Memory pool used; defaults to Shared.
options
CsvIOOptionsOptions to configure the reader
Returns
Remarks
If the stream is a MemoryStream, the buffer is accessed directly for zero-copy reads if possible; see NoDirectBufferAccess.
Create(Stream, Encoding?, MemoryPool<char>?, CsvIOOptions)
public static ICsvBufferReader<char> Create(Stream stream, Encoding? encoding = null, MemoryPool<char>? memoryPool = null, CsvIOOptions options = default)
Parameters
stream
StreamThe stream
encoding
EncodingEncoding used to read the bytes
memoryPool
MemoryPool<char>Memory pool used; defaults to Shared.
options
CsvIOOptionsOptions to configure the reader
Returns
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, MemoryPool<char>?, CsvIOOptions)
Creates a new CSV reader instance from a TextReader.
public static ICsvBufferReader<char> Create(TextReader reader, MemoryPool<char>? memoryPool = null, CsvIOOptions options = default)
Parameters
reader
TextReaderThe text reader
memoryPool
MemoryPool<char>Memory pool used; defaults to Shared.
options
CsvIOOptionsOptions to configure the reader
Returns
Remarks
If the stream is a StringReader, the internal string is accessed directly for zero-copy reads; see NoDirectBufferAccess.
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
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
Create(string?)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<char> Create(string? csv)
Parameters
csv
stringCSV data
Returns
Create(StringBuilder?)
Creates a new reader over the CSV data.
public static ICsvBufferReader<char> Create(StringBuilder? csv)
Parameters
csv
StringBuilderString builder containing the CSV
Returns
Remarks
The StringBuilder must not be modified while the reader is in use.
Create<T>(in ReadOnlySequence<T>, MemoryPool<T>?, CsvIOOptions)
Creates a new pipe reader over the CSV data.
public static ICsvBufferReader<T> Create<T>(in ReadOnlySequence<T> csv, MemoryPool<T>? memoryPool = null, CsvIOOptions options = default) where T : unmanaged
Parameters
csv
ReadOnlySequence<T>CSV data
memoryPool
MemoryPool<T>options
CsvIOOptions
Returns
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
Parameters
csv
ReadOnlyMemory<T>CSV data
Returns
Type Parameters
T