Providers a uniform way to encode the data.
Namespace: DotNext.IO Assembly: DotNext.IO.dll Syntaxpublic interface IAsyncBinaryWriter : ISupplier<ReadOnlyMemory<byte>, CancellationToken, ValueTask>, IFunctional<Func<ReadOnlyMemory<byte>, CancellationToken, ValueTask>>
Properties | Edit this page View Source Buffer
Gets buffer to modify.
DeclarationMemory<byte> Buffer { get; }
Property Value See Also Methods | Edit this page View Source AdvanceAsync(int, CancellationToken)
Instructs the writer that the specified number of bytes of Buffer is modified.
DeclarationValueTask AdvanceAsync(int bytesWritten, CancellationToken token = default)
Parameters Type Name Description int bytesWritten
The number of written bytes to Buffer.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Exceptions | Edit this page View Source CopyFromAsync(PipeReader, long?, CancellationToken)Writes the content from the specified pipe.
DeclarationValueTask CopyFromAsync(PipeReader source, long? count = null, CancellationToken token = default)
Parameters Type Name Description PipeReader source
The pipe to read from.
long? countThe number of bytes to read from the source.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Exceptions | Edit this page View Source CopyFromAsync(Stream, long?, CancellationToken)Writes the content from the specified stream.
DeclarationValueTask CopyFromAsync(Stream source, long? count = null, CancellationToken token = default)
Parameters Type Name Description Stream source
The stream to read from the source.
long? countThe number of bytes to read from the source.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Exceptions | Edit this page View Source Create(IBufferWriter<byte>)Creates default implementation of binary writer for the buffer writer.
Declarationpublic static IAsyncBinaryWriter Create(IBufferWriter<byte> writer)
Parameters Returns Exceptions | Edit this page View Source Create(PipeWriter, long)
Creates default implementation of binary writer for the pipe.
Declarationpublic static IAsyncBinaryWriter Create(PipeWriter output, long bufferSize = 0)
Parameters Type Name Description PipeWriter output
The stream instance.
long bufferSizeThe maximum numbers of bytes that can be buffered in the memory without flushing.
Returns Exceptions | Edit this page View Source Create(Stream, Memory<byte>)Creates default implementation of binary writer for the stream.
Declarationpublic static IAsyncBinaryWriter Create(Stream output, Memory<byte> buffer)
Parameters Type Name Description Stream output
The stream instance.
Memory<byte> bufferThe buffer used for encoding binary data.
Returns Exceptions | Edit this page View Source EncodeAsync(ReadOnlyMemory<char>, EncodingContext, LengthFormat?, CancellationToken)Encodes a block of characters using the specified encoding.
DeclarationValueTask<long> EncodeAsync(ReadOnlyMemory<char> chars, EncodingContext context, LengthFormat? lengthFormat = null, CancellationToken token = default)
Parameters Returns Exceptions | Edit this page View Source FormatAsync<T>(T, EncodingContext, LengthFormat?, string?, IFormatProvider?, MemoryAllocator<char>?, CancellationToken)
Encodes formattable value as a set of characters using the specified encoding.
DeclarationValueTask<long> FormatAsync<T>(T value, EncodingContext context, LengthFormat? lengthFormat = null, string? format = null, IFormatProvider? provider = null, MemoryAllocator<char>? allocator = null, CancellationToken token = default) where T : ISpanFormattable
Parameters Returns Type Parameters Name Description T
The type of formattable value.
Exceptions | Edit this page View Source FormatAsync<T>(T, LengthFormat?, string?, IFormatProvider?, CancellationToken)Converts the value to UTF-8 encoded characters.
DeclarationValueTask<int> FormatAsync<T>(T value, LengthFormat? lengthFormat, string? format = null, IFormatProvider? provider = null, CancellationToken token = default) where T : IUtf8SpanFormattable
Parameters Type Name Description T value
The value to convert.
LengthFormat? lengthFormatString length encoding format.
string formatThe format of the value.
IFormatProvider providerThe format provider.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTask<int>The number of written bytes.
Type Parameters Name Description TThe type of the value to convert.
Exceptions | Edit this page View Source TryGetBufferWriter()Attempts to get synchronous writer.
DeclarationIBufferWriter<byte>? TryGetBufferWriter()
Returns Type Description IBufferWriter<byte>
Synchronous writer wrapped by this asynchronous writer; or null if underlying I/O is fully asynchronous.
| Edit this page View Source WriteAsync(ReadOnlyMemory<byte>, LengthFormat?, CancellationToken)Encodes a block of memory, optionally prefixed with the length encoded as a sequence of bytes according with the specified format.
DeclarationValueTask WriteAsync(ReadOnlyMemory<byte> input, LengthFormat? lengthFormat = null, CancellationToken token = default)
Parameters Type Name Description ReadOnlyMemory<byte> input
A block of memory.
LengthFormat? lengthFormatIndicates how the length of the BLOB must be encoded; or null to prevent length encoding.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Exceptions | Edit this page View Source WriteAsync<T>(T, CancellationToken)Encodes formattable value as a set of bytes.
DeclarationValueTask WriteAsync<T>(T value, CancellationToken token = default) where T : IBinaryFormattable<T>
Parameters Type Name Description T value
The value to be written as a sequence of bytes.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Type Parameters Name Description TThe type of formattable value.
Exceptions | Edit this page View Source WriteBigEndianAsync<T>(T, CancellationToken)Writes integer value in big-endian format.
DeclarationValueTask WriteBigEndianAsync<T>(T value, CancellationToken token = default) where T : IBinaryInteger<T>
Parameters Type Name Description T value
The value to be written in big-endian format.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Type Parameters Name Description TThe integer type.
Exceptions | Edit this page View Source WriteLittleEndianAsync<T>(T, CancellationToken)Writes integer value in little-endian format.
DeclarationValueTask WriteLittleEndianAsync<T>(T value, CancellationToken token = default) where T : IBinaryInteger<T>
Parameters Type Name Description T value
The value to be written in little-endian format.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Type Parameters Name Description TThe integer type.
Exceptions Extension Methods See AlsoRetroSearch 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