ValueTask IAsyncBinaryWriter.WriteBigIntegerAsync(BigInteger value, LengthFormat lengthFormat, EncodingContext context, string?format, IFormatProvider?provider, CancellationToken token) { ValueTask result; if (token.IsCancellationRequested) { #if NETSTANDARD2_1 result = new (Task.FromCanceled(token)); #else result = ValueTask.FromCanceled(token); #endif } else { result = new(); try { writer.WriteBigInteger(value, lengthFormat, in context, format, provider); } catch (Exception e) { #if NETSTANDARD2_1 result = new (Task.FromException(e)); #else result = ValueTask.FromException(e); #endif } } return(result); }
ValueTask IAsyncBinaryWriter.WriteBigIntegerAsync(BigInteger value, LengthFormat lengthFormat, EncodingContext context, string?format, IFormatProvider?provider, CancellationToken token) { Task result; if (token.IsCancellationRequested) { result = Task.FromCanceled(token); } else { result = Task.CompletedTask; try { writer.WriteBigInteger(value, lengthFormat, in context, format, provider); } catch (Exception e) { result = Task.FromException(e); } } return(new ValueTask(result)); }
public ValueTask <string> ReadStringAsync(LengthFormat lengthFormat, DecodingContext context, CancellationToken token = default) => StreamExtensions.ReadStringAsync(stream, lengthFormat, context, buffer, token);
ValueTask <MemoryOwner <byte> > IAsyncBinaryReader.ReadAsync(LengthFormat lengthFormat, MemoryAllocator <byte>?allocator, CancellationToken token) => StreamExtensions.ReadBlockAsync(stream, lengthFormat, buffer, allocator, token);
ValueTask IAsyncBinaryWriter.WriteBigIntegerAsync(BigInteger value, LengthFormat lengthFormat, EncodingContext context, string?format, IFormatProvider?provider, CancellationToken token) => stream.WriteBigIntegerAsync(value, lengthFormat, context, buffer, format, provider, token);
ValueTask <BigInteger> IAsyncBinaryReader.ReadBigIntegerAsync(LengthFormat lengthFormat, bool littleEndian, CancellationToken token) => StreamExtensions.ReadBigIntegerAsync(stream, lengthFormat, littleEndian, token);
ValueTask <TimeSpan> IAsyncBinaryReader.ReadTimeSpanAsync(LengthFormat lengthFormat, DecodingContext context, string[] formats, TimeSpanStyles style, IFormatProvider?provider, CancellationToken token) => StreamExtensions.ReadTimeSpanAsync(stream, lengthFormat, context, buffer, formats, style, provider, token);
ValueTask <BigInteger> IAsyncBinaryReader.ReadBigIntegerAsync(LengthFormat lengthFormat, bool littleEndian, CancellationToken token) => EndOfStream <BigInteger>();
public static ValueTask <FlushResult> WriteSByteAsync(this PipeWriter writer, sbyte value, LengthFormat lengthFormat, EncodingContext context, string?format = null, IFormatProvider?provider = null, CancellationToken token = default) { writer.WriteSByte(value, lengthFormat, in context, format, provider); return(writer.FlushAsync(token)); }
ValueTask <BigInteger> IAsyncBinaryReader.ReadBigIntegerAsync(LengthFormat lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider?provider, CancellationToken token) => EndOfStream <BigInteger>();
ValueTask <Guid> IAsyncBinaryReader.ReadGuidAsync(LengthFormat lengthFormat, DecodingContext context, string format, CancellationToken token) => EndOfStream <Guid>();
ValueTask <TimeSpan> IAsyncBinaryReader.ReadTimeSpanAsync(LengthFormat lengthFormat, DecodingContext context, string[] formats, TimeSpanStyles style, IFormatProvider?provider, CancellationToken token) => EndOfStream <TimeSpan>();
ValueTask <DateTimeOffset> IAsyncBinaryReader.ReadDateTimeOffsetAsync(LengthFormat lengthFormat, DecodingContext context, string[] formats, DateTimeStyles style, IFormatProvider?provider, CancellationToken token) => EndOfStream <DateTimeOffset>();
public ValueTask <string> ReadStringAsync(LengthFormat lengthFormat, DecodingContext context, CancellationToken token) => EndOfStream <string>();
public ValueTask <MemoryOwner <byte> > ReadAsync(LengthFormat lengthFormat, MemoryAllocator <byte>?allocator, CancellationToken token) => EndOfStream <MemoryOwner <byte> >();
ValueTask <byte> IAsyncBinaryReader.ReadByteAsync(LengthFormat lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider?provider, CancellationToken token) => StreamExtensions.ReadByteAsync(stream, lengthFormat, context, buffer, style, provider, token);
public static ValueTask <FlushResult> WriteGuidAsync(this PipeWriter writer, Guid value, LengthFormat lengthFormat, EncodingContext context, string?format = null, CancellationToken token = default) { writer.WriteGuid(value, lengthFormat, in context, format); return(writer.FlushAsync(token)); }
ValueTask <Guid> IAsyncBinaryReader.ReadGuidAsync(LengthFormat lengthFormat, DecodingContext context, string format, CancellationToken token) => StreamExtensions.ReadGuidAsync(stream, lengthFormat, context, buffer, format, token);
ValueTask <MemoryOwner <byte> > IAsyncBinaryReader.ReadAsync(LengthFormat lengthFormat, MemoryAllocator <byte> allocator, CancellationToken token) => reader.ReadAsync(lengthFormat, allocator, token);
ValueTask <DateTimeOffset> IAsyncBinaryReader.ReadDateTimeOffsetAsync(LengthFormat lengthFormat, DecodingContext context, DateTimeStyles style, IFormatProvider?provider, CancellationToken token) => StreamExtensions.ReadDateTimeOffsetAsync(stream, lengthFormat, context, buffer, style, provider, token);