Represents various extension methods for TextWriter and TextReader classes.
InheritanceTextStreamExtensions
Namespace: DotNext.IO Assembly: DotNext.IO.dll Syntaxpublic static class TextStreamExtensions
Methods | Edit this page View Source AsTextReader(ReadOnlySequence<byte>, Encoding, int, MemoryAllocator<char>?)
Creates TextReader over the sequence of encoded characters.
Declarationpublic static TextReader AsTextReader(this ReadOnlySequence<byte> sequence, Encoding encoding, int bufferSize = 1024, MemoryAllocator<char>? allocator = null)
Parameters Type Name Description ReadOnlySequence<byte> sequence
The sequence of bytes representing encoded characters.
Encoding encodingThe encoding of the characters in the sequence.
int bufferSizeThe size of the internal char buffer used to decode characters.
MemoryAllocator<char> allocatorThe allocator of the internal buffer.
Returns Type Description TextReaderThe reader over the sequence of encoded characters.
Exceptions | Edit this page View Source AsTextReader(ReadOnlySequence<char>)Creates TextReader over the sequence of characters.
Declarationpublic static TextReader AsTextReader(this ReadOnlySequence<char> sequence)
Parameters Returns Type Description TextReader
The reader over the sequence of characters.
| Edit this page View Source AsTextWriter<TWriter>(TWriter, IFormatProvider?, Action<TWriter>?, Func<TWriter, CancellationToken, Task>?)Creates text writer backed by the char buffer writer.
Declarationpublic static TextWriter AsTextWriter<TWriter>(this TWriter writer, IFormatProvider? provider = null, Action<TWriter>? flush = null, Func<TWriter, CancellationToken, Task>? flushAsync = null) where TWriter : class, IBufferWriter<char>
Parameters Returns Type Description TextWriter
The text writer backed by the buffer writer.
Type Parameters Name Description TWriterThe type of the char buffer writer.
| Edit this page View Source AsTextWriter<TWriter>(TWriter, Encoding, IFormatProvider?, Action<TWriter>?, Func<TWriter, CancellationToken, Task>?)Creates text writer backed by the byte buffer writer.
Declarationpublic static TextWriter AsTextWriter<TWriter>(this TWriter writer, Encoding encoding, IFormatProvider? provider = null, Action<TWriter>? flush = null, Func<TWriter, CancellationToken, Task>? flushAsync = null) where TWriter : class, IBufferWriter<byte>
Parameters Returns Type Description TextWriter
The text writer backed by the buffer writer.
Type Parameters Name Description TWriterThe type of the char buffer writer.
Exceptions | Edit this page View Source ReadAllAsync(TextReader, int, MemoryAllocator<char>?, CancellationToken)Reads text stream sequentially.
Declarationpublic static IAsyncEnumerable<ReadOnlyMemory<char>> ReadAllAsync(this TextReader reader, int bufferSize, MemoryAllocator<char>? allocator = null, CancellationToken token = default)
Parameters Returns Exceptions | Edit this page View Source Write(TextWriter, MemoryAllocator<char>?, ref PoolingInterpolatedStringHandler)
Writes interpolated string and appends a new line after it.
Declarationpublic static void Write(this TextWriter writer, MemoryAllocator<char>? allocator, ref PoolingInterpolatedStringHandler handler)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
| Edit this page View Source Write(TextWriter, MemoryAllocator<char>?, IFormatProvider?, ref PoolingInterpolatedStringHandler)Writes interpolated string and appends a new line after it.
Declarationpublic static void Write(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, ref PoolingInterpolatedStringHandler handler)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
IFormatProvider providerOptional formatting provider to be applied for each interpolated string argument.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
| Edit this page View Source WriteAsync(TextWriter, MemoryAllocator<char>?, ref PoolingInterpolatedStringHandler, CancellationToken)Writes interpolated string.
Declarationpublic static ValueTask WriteAsync(this TextWriter writer, MemoryAllocator<char>? allocator, ref PoolingInterpolatedStringHandler handler, CancellationToken token = default)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskA task that represents the asynchronous write operation.
| Edit this page View Source WriteAsync(TextWriter, MemoryAllocator<char>?, IFormatProvider?, ref PoolingInterpolatedStringHandler, CancellationToken)Writes interpolated string.
Declarationpublic static ValueTask WriteAsync(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, ref PoolingInterpolatedStringHandler handler, CancellationToken token = default)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
IFormatProvider providerOptional formatting provider to be applied for each interpolated string argument.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskA task that represents the asynchronous write operation.
| Edit this page View Source WriteAsync(TextWriter, ReadOnlySequence<char>, CancellationToken)Asynchronously writes a linked regions of characters to the text stream.
Declarationpublic static ValueTask WriteAsync(this TextWriter writer, ReadOnlySequence<char> chars, CancellationToken token = default)
Parameters Returns Type Description ValueTask
The task representing asynchronous execution of this method.
Exceptions | Edit this page View Source WriteLine(TextWriter, MemoryAllocator<char>?, ref PoolingInterpolatedStringHandler)Writes interpolated string and appends a new line after it.
Declarationpublic static void WriteLine(this TextWriter writer, MemoryAllocator<char>? allocator, ref PoolingInterpolatedStringHandler handler)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
| Edit this page View Source WriteLine(TextWriter, MemoryAllocator<char>?, IFormatProvider?, ref PoolingInterpolatedStringHandler)Writes interpolated string and appends a new line after it.
Declarationpublic static void WriteLine(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, ref PoolingInterpolatedStringHandler handler)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
IFormatProvider providerOptional formatting provider to be applied for each interpolated string argument.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
| Edit this page View Source WriteLineAsync(TextWriter, MemoryAllocator<char>?, ref PoolingInterpolatedStringHandler, CancellationToken)Writes interpolated string and appends a new line after it.
Declarationpublic static ValueTask WriteLineAsync(this TextWriter writer, MemoryAllocator<char>? allocator, ref PoolingInterpolatedStringHandler handler, CancellationToken token = default)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskA task that represents the asynchronous write operation.
| Edit this page View Source WriteLineAsync(TextWriter, MemoryAllocator<char>?, IFormatProvider?, ref PoolingInterpolatedStringHandler, CancellationToken)Writes interpolated string and appends a new line after it.
Declarationpublic static ValueTask WriteLineAsync(this TextWriter writer, MemoryAllocator<char>? allocator, IFormatProvider? provider, ref PoolingInterpolatedStringHandler handler, CancellationToken token = default)
Parameters Type Name Description TextWriter writer
An output for the interpolated string.
MemoryAllocator<char> allocatorThe allocator for the buffer used by string interpolation handler.
IFormatProvider providerOptional formatting provider to be applied for each interpolated string argument.
PoolingInterpolatedStringHandler handlerThe interpolated string handler.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskA task that represents the asynchronous write operation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4