Struct SequenceBinaryReader
Represents binary reader for the sequence of bytes.
Implements
Inherited Members
Namespace: DotNext.IO
Assembly: DotNext.IO.dll
Syntax
public struct SequenceBinaryReader : IAsyncBinaryReader
Methods
| Improve this Doc View SourceRead(Memory<Byte>)
Copies the bytes from the sequence into contiguous block of memory.
Declaration
public void Read(Memory<byte> output)
Parameters
Type | Name | Description |
---|---|---|
Memory<Byte> | output | The block of memory to fill. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | Unexpected end of sequence. |
Read<T>()
Decodes the value of blittable type from the sequence of bytes.
Declaration
public T Read<T>()
where T : struct
Returns
Type | Description |
---|---|
T | The decoded value. |
Type Parameters
Name | Description |
---|---|
T | The type of the value to decode. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | Unexpected end of sequence. |
ReadByte(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 8-bit unsigned integer from its string representation encoded in the underlying stream.
Declaration
public byte ReadByte(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
Byte | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadDateTime(StringLengthEncoding, DecodingContext, DateTimeStyles, IFormatProvider)
Parses DateTime from its string representation encoded in the underlying stream.
Declaration
public DateTime ReadDateTime(StringLengthEncoding lengthFormat, in DecodingContext context, DateTimeStyles style = DateTimeStyles.None, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
DateTimeStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
DateTime | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The date/time is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadDateTime(StringLengthEncoding, DecodingContext, String[], DateTimeStyles, IFormatProvider)
Parses DateTime from its string representation encoded in the underlying stream.
Declaration
public DateTime ReadDateTime(StringLengthEncoding lengthFormat, in DecodingContext context, string[] formats, DateTimeStyles style = DateTimeStyles.None, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
String[] | formats | An array of allowable formats. |
DateTimeStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
DateTime | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The date/time is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadDateTimeOffset(StringLengthEncoding, DecodingContext, DateTimeStyles, IFormatProvider)
Parses DateTimeOffset from its string representation encoded in the underlying stream.
Declaration
public DateTimeOffset ReadDateTimeOffset(StringLengthEncoding lengthFormat, in DecodingContext context, DateTimeStyles style = DateTimeStyles.None, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
DateTimeStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
DateTimeOffset | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The date/time is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadDateTimeOffset(StringLengthEncoding, DecodingContext, String[], DateTimeStyles, IFormatProvider)
Parses DateTimeOffset from its string representation encoded in the underlying stream.
Declaration
public DateTimeOffset ReadDateTimeOffset(StringLengthEncoding lengthFormat, in DecodingContext context, string[] formats, DateTimeStyles style = DateTimeStyles.None, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
String[] | formats | An array of allowable formats. |
DateTimeStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
DateTimeOffset | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The date/time is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadDecimal(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses Decimal from its string representation encoded in the underlying stream.
Declaration
public decimal ReadDecimal(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowThousands | NumberStyles.AllowTrailingSign | NumberStyles.AllowTrailingWhite | NumberStyles.Integer | NumberStyles.Number, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
Decimal | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadDouble(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses double-precision floating-point number from its string representation encoded in the underlying stream.
Declaration
public double ReadDouble(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent | NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowThousands | NumberStyles.AllowTrailingWhite | NumberStyles.Float | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
Double | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadGuid(StringLengthEncoding, DecodingContext)
Parses Guid from its string representation encoded in the underlying stream.
Declaration
public Guid ReadGuid(StringLengthEncoding lengthFormat, in DecodingContext context)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
Returns
Type | Description |
---|---|
Guid | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | GUID value is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadGuid(StringLengthEncoding, DecodingContext, String)
Parses Guid from its string representation encoded in the underlying stream.
Declaration
public Guid ReadGuid(StringLengthEncoding lengthFormat, in DecodingContext context, string format)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
String | format | The expected format of GUID value. |
Returns
Type | Description |
---|---|
Guid | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | GUID value is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadInt16(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 16-bit signed integer from its string representation encoded in the underlying stream.
Declaration
public short ReadInt16(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
Int16 | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadInt16(Boolean)
Decodes 16-bit signed integer using the specified endianness.
Declaration
public short ReadInt16(bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | true if value is stored in the underlying binary stream as little-endian; otherwise, use big-endian. |
Returns
Type | Description |
---|---|
Int16 | The decoded value. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying sequence doesn't contain necessary amount of bytes to decode the value. |
ReadInt32(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 32-bit signed integer from its string representation encoded in the underlying stream.
Declaration
public int ReadInt32(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
Int32 | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadInt32(Boolean)
Decodes 32-bit signed integer using the specified endianness.
Declaration
public int ReadInt32(bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | true if value is stored in the underlying binary stream as little-endian; otherwise, use big-endian. |
Returns
Type | Description |
---|---|
Int32 | The decoded value. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying sequence doesn't contain necessary amount of bytes to decode the value. |
ReadInt64(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 64-bit signed integer from its string representation encoded in the underlying stream.
Declaration
public long ReadInt64(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
Int64 | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadInt64(Boolean)
Decodes 64-bit signed integer using the specified endianness.
Declaration
public long ReadInt64(bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | true if value is stored in the underlying binary stream as little-endian; otherwise, use big-endian. |
Returns
Type | Description |
---|---|
Int64 | The decoded value. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying sequence doesn't contain necessary amount of bytes to decode the value. |
ReadSByte(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 8-bit unsigned integer from its string representation encoded in the underlying stream.
Declaration
[CLSCompliant(false)]
public sbyte ReadSByte(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
SByte | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadSingle(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses single-precision floating-point number from its string representation encoded in the underlying stream.
Declaration
public float ReadSingle(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent | NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowThousands | NumberStyles.AllowTrailingWhite | NumberStyles.Float | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
Single | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadString(StringLengthEncoding, DecodingContext)
Decodes the string.
Declaration
public string ReadString(StringLengthEncoding lengthFormat, in DecodingContext context)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
Returns
Type | Description |
---|---|
String | The decoded string. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadString(Int32, DecodingContext)
Decodes the string.
Declaration
public string ReadString(int length, in DecodingContext context)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length | The length of the encoded string, in bytes. |
DecodingContext | context | The decoding context containing string characters encoding. |
Returns
Type | Description |
---|---|
String | The decoded string. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadTimeSpan(StringLengthEncoding, DecodingContext, IFormatProvider)
Parses TimeSpan from its string representation encoded in the underlying stream.
Declaration
public TimeSpan ReadTimeSpan(StringLengthEncoding lengthFormat, in DecodingContext context, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
TimeSpan | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The time span is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadTimeSpan(StringLengthEncoding, DecodingContext, String[], TimeSpanStyles, IFormatProvider)
Parses TimeSpan from its string representation encoded in the underlying stream.
Declaration
public TimeSpan ReadTimeSpan(StringLengthEncoding lengthFormat, in DecodingContext context, string[] formats, TimeSpanStyles style = TimeSpanStyles.None, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
String[] | formats | An array of allowable formats. |
TimeSpanStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
TimeSpan | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The time span is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadUInt16(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 16-bit unsigned integer from its string representation encoded in the underlying stream.
Declaration
[CLSCompliant(false)]
public ushort ReadUInt16(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
UInt16 | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadUInt16(Boolean)
Decodes 16-bit unsigned integer using the specified endianness.
Declaration
[CLSCompliant(false)]
public ushort ReadUInt16(bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | true if value is stored in the underlying binary stream as little-endian; otherwise, use big-endian. |
Returns
Type | Description |
---|---|
UInt16 | The decoded value. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying sequence doesn't contain necessary amount of bytes to decode the value. |
ReadUInt32(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 32-bit unsigned integer from its string representation encoded in the underlying stream.
Declaration
[CLSCompliant(false)]
public uint ReadUInt32(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
UInt32 | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadUInt32(Boolean)
Decodes 32-bit unsigned integer using the specified endianness.
Declaration
[CLSCompliant(false)]
public uint ReadUInt32(bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | true if value is stored in the underlying binary stream as little-endian; otherwise, use big-endian. |
Returns
Type | Description |
---|---|
UInt32 | The decoded value. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying sequence doesn't contain necessary amount of bytes to decode the value. |
ReadUInt64(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider)
Parses 64-bit unsigned integer from its string representation encoded in the underlying stream.
Declaration
[CLSCompliant(false)]
public ulong ReadUInt64(StringLengthEncoding lengthFormat, in DecodingContext context, NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.Integer, IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | The format of the string length encoded in the stream. |
DecodingContext | context | The decoding context containing string characters encoding. |
NumberStyles | style | A bitwise combination of the enumeration values that indicates the style elements. |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
UInt64 | The parsed value. |
Exceptions
Type | Condition |
---|---|
FormatException | The number is in incorrect format. |
EndOfStreamException | The underlying source doesn't contain necessary amount of bytes to decode the value. |
ReadUInt64(Boolean)
Decodes 64-bit unsigned integer using the specified endianness.
Declaration
[CLSCompliant(false)]
public ulong ReadUInt64(bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | true if value is stored in the underlying binary stream as little-endian; otherwise, use big-endian. |
Returns
Type | Description |
---|---|
UInt64 | The decoded value. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | The underlying sequence doesn't contain necessary amount of bytes to decode the value. |
Reset()
Resets the reader so it can be used again.
Declaration
public void Reset()
Explicit Interface Implementations
| Improve this Doc View SourceIAsyncBinaryReader.CopyToAsync(IBufferWriter<Byte>, CancellationToken)
Declaration
Task IAsyncBinaryReader.CopyToAsync(IBufferWriter<byte> writer, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | |
CancellationToken | token |
Returns
Type | Description |
---|---|
Task |
IAsyncBinaryReader.CopyToAsync(PipeWriter, CancellationToken)
Declaration
Task IAsyncBinaryReader.CopyToAsync(PipeWriter output, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
PipeWriter | output | |
CancellationToken | token |
Returns
Type | Description |
---|---|
Task |
IAsyncBinaryReader.CopyToAsync(Stream, CancellationToken)
Declaration
Task IAsyncBinaryReader.CopyToAsync(Stream output, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Stream | output | |
CancellationToken | token |
Returns
Type | Description |
---|---|
Task |
IAsyncBinaryReader.CopyToAsync<TArg>(ReadOnlySpanAction<Byte, TArg>, TArg, CancellationToken)
Declaration
Task IAsyncBinaryReader.CopyToAsync<TArg>(ReadOnlySpanAction<byte, TArg> reader, TArg arg, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpanAction<Byte, TArg> | reader | |
TArg | arg | |
CancellationToken | token |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TArg |
IAsyncBinaryReader.CopyToAsync<TArg>(Func<ReadOnlyMemory<Byte>, TArg, CancellationToken, ValueTask>, TArg, CancellationToken)
Declaration
Task IAsyncBinaryReader.CopyToAsync<TArg>(Func<ReadOnlyMemory<byte>, TArg, CancellationToken, ValueTask> reader, TArg arg, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Func<ReadOnlyMemory<Byte>, TArg, CancellationToken, ValueTask> | reader | |
TArg | arg | |
CancellationToken | token |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TArg |
IAsyncBinaryReader.ReadAsync(Memory<Byte>, CancellationToken)
Declaration
ValueTask IAsyncBinaryReader.ReadAsync(Memory<byte> output, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Memory<Byte> | output | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask |
IAsyncBinaryReader.ReadAsync<T>(CancellationToken)
Declaration
ValueTask<T> IAsyncBinaryReader.ReadAsync<T>(CancellationToken token)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<T> |
Type Parameters
Name | Description |
---|---|
T |
IAsyncBinaryReader.ReadByteAsync(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<byte> IAsyncBinaryReader.ReadByteAsync(StringLengthEncoding lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
NumberStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Byte> |
IAsyncBinaryReader.ReadDateTimeAsync(StringLengthEncoding, DecodingContext, DateTimeStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<DateTime> IAsyncBinaryReader.ReadDateTimeAsync(StringLengthEncoding lengthFormat, DecodingContext context, DateTimeStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
DateTimeStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<DateTime> |
IAsyncBinaryReader.ReadDateTimeAsync(StringLengthEncoding, DecodingContext, String[], DateTimeStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<DateTime> IAsyncBinaryReader.ReadDateTimeAsync(StringLengthEncoding lengthFormat, DecodingContext context, string[] formats, DateTimeStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
String[] | formats | |
DateTimeStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<DateTime> |
IAsyncBinaryReader.ReadDateTimeOffsetAsync(StringLengthEncoding, DecodingContext, DateTimeStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<DateTimeOffset> IAsyncBinaryReader.ReadDateTimeOffsetAsync(StringLengthEncoding lengthFormat, DecodingContext context, DateTimeStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
DateTimeStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<DateTimeOffset> |
IAsyncBinaryReader.ReadDateTimeOffsetAsync(StringLengthEncoding, DecodingContext, String[], DateTimeStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<DateTimeOffset> IAsyncBinaryReader.ReadDateTimeOffsetAsync(StringLengthEncoding lengthFormat, DecodingContext context, string[] formats, DateTimeStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
String[] | formats | |
DateTimeStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<DateTimeOffset> |
IAsyncBinaryReader.ReadDecimalAsync(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<decimal> IAsyncBinaryReader.ReadDecimalAsync(StringLengthEncoding lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
NumberStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Decimal> |
IAsyncBinaryReader.ReadDoubleAsync(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<double> IAsyncBinaryReader.ReadDoubleAsync(StringLengthEncoding lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
NumberStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Double> |
IAsyncBinaryReader.ReadGuidAsync(StringLengthEncoding, DecodingContext, String, CancellationToken)
Declaration
ValueTask<Guid> IAsyncBinaryReader.ReadGuidAsync(StringLengthEncoding lengthFormat, DecodingContext context, string format, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
String | format | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Guid> |
IAsyncBinaryReader.ReadGuidAsync(StringLengthEncoding, DecodingContext, CancellationToken)
Declaration
ValueTask<Guid> IAsyncBinaryReader.ReadGuidAsync(StringLengthEncoding lengthFormat, DecodingContext context, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Guid> |
IAsyncBinaryReader.ReadInt16Async(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<short> IAsyncBinaryReader.ReadInt16Async(StringLengthEncoding lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
NumberStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Int16> |
IAsyncBinaryReader.ReadInt16Async(Boolean, CancellationToken)
Declaration
ValueTask<short> IAsyncBinaryReader.ReadInt16Async(bool littleEndian, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Int16> |
IAsyncBinaryReader.ReadInt32Async(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<int> IAsyncBinaryReader.ReadInt32Async(StringLengthEncoding lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
NumberStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Int32> |
IAsyncBinaryReader.ReadInt32Async(Boolean, CancellationToken)
Declaration
ValueTask<int> IAsyncBinaryReader.ReadInt32Async(bool littleEndian, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Int32> |
IAsyncBinaryReader.ReadInt64Async(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<long> IAsyncBinaryReader.ReadInt64Async(StringLengthEncoding lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
NumberStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Int64> |
IAsyncBinaryReader.ReadInt64Async(Boolean, CancellationToken)
Declaration
ValueTask<long> IAsyncBinaryReader.ReadInt64Async(bool littleEndian, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Boolean | littleEndian | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Int64> |
IAsyncBinaryReader.ReadSingleAsync(StringLengthEncoding, DecodingContext, NumberStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<float> IAsyncBinaryReader.ReadSingleAsync(StringLengthEncoding lengthFormat, DecodingContext context, NumberStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
NumberStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<Single> |
IAsyncBinaryReader.ReadStringAsync(StringLengthEncoding, DecodingContext, CancellationToken)
Declaration
ValueTask<string> IAsyncBinaryReader.ReadStringAsync(StringLengthEncoding lengthFormat, DecodingContext context, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<String> |
IAsyncBinaryReader.ReadStringAsync(Int32, DecodingContext, CancellationToken)
Declaration
ValueTask<string> IAsyncBinaryReader.ReadStringAsync(int length, DecodingContext context, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length | |
DecodingContext | context | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<String> |
IAsyncBinaryReader.ReadTimeSpanAsync(StringLengthEncoding, DecodingContext, IFormatProvider, CancellationToken)
Declaration
ValueTask<TimeSpan> IAsyncBinaryReader.ReadTimeSpanAsync(StringLengthEncoding lengthFormat, DecodingContext context, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<TimeSpan> |
IAsyncBinaryReader.ReadTimeSpanAsync(StringLengthEncoding, DecodingContext, String[], TimeSpanStyles, IFormatProvider, CancellationToken)
Declaration
ValueTask<TimeSpan> IAsyncBinaryReader.ReadTimeSpanAsync(StringLengthEncoding lengthFormat, DecodingContext context, string[] formats, TimeSpanStyles style, IFormatProvider provider, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
StringLengthEncoding | lengthFormat | |
DecodingContext | context | |
String[] | formats | |
TimeSpanStyles | style | |
IFormatProvider | provider | |
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask<TimeSpan> |