SequenceReaderExtensions.TryReadLittleEndian 方法

定义

重载

TryReadLittleEndian(SequenceReader<Byte>, Int16)

尝试将 Int16 读取为小字节序。Tries to read an Int16 as little endian.

TryReadLittleEndian(SequenceReader<Byte>, Int32)

尝试将 Int32 读取为小字节序。Tries to read an Int32 as little endian.

TryReadLittleEndian(SequenceReader<Byte>, Int64)

尝试将 Int64 读取为小字节序。Tries to read an Int64 as little endian.

TryReadLittleEndian(SequenceReader<Byte>, Int16)

尝试将 Int16 读取为小字节序。Tries to read an Int16 as little endian.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryReadLittleEndian(System::Buffers::SequenceReader<System::Byte> % reader, [Runtime::InteropServices::Out] short % value);
public static bool TryReadLittleEndian (this ref System.Buffers.SequenceReader<byte> reader, out short value);
static member TryReadLittleEndian : SequenceReader * int16 -> bool
<Extension()>
Public Function TryReadLittleEndian (ByRef reader As SequenceReader(Of Byte), ByRef value As Short) As Boolean

参数

reader
SequenceReader<Byte>

要从中读取值的字节序列读取器实例。The byte sequence reader instance from which the value is to be read.

value
Int16

当该方法返回时,作为小字节序从字节序列读取器读取的值。When the method returns, the value read out of the byte sequence reader, as little endian.

返回

Boolean

如果读取操作成功,则为 true;如果没有足够的数据用于 Int16,则为 falsetrue if the read operation is successful; false if there isn't enough data for an Int16.

适用于

TryReadLittleEndian(SequenceReader<Byte>, Int32)

尝试将 Int32 读取为小字节序。Tries to read an Int32 as little endian.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryReadLittleEndian(System::Buffers::SequenceReader<System::Byte> % reader, [Runtime::InteropServices::Out] int % value);
public static bool TryReadLittleEndian (this ref System.Buffers.SequenceReader<byte> reader, out int value);
static member TryReadLittleEndian : SequenceReader * int -> bool
<Extension()>
Public Function TryReadLittleEndian (ByRef reader As SequenceReader(Of Byte), ByRef value As Integer) As Boolean

参数

reader
SequenceReader<Byte>

要从中读取值的字节序列读取器实例。The byte sequence reader instance from which the value is to be read.

value
Int32

当该方法返回时,作为小字节序从字节序列读取器读取的值。When the method returns, the value read out of the byte sequence reader, as little endian.

返回

Boolean

如果读取操作成功,则为 true;如果没有足够的数据用于 Int32,则为 falsetrue if the read operation is successful; false if there isn't enough data for an Int32.

适用于

TryReadLittleEndian(SequenceReader<Byte>, Int64)

尝试将 Int64 读取为小字节序。Tries to read an Int64 as little endian.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryReadLittleEndian(System::Buffers::SequenceReader<System::Byte> % reader, [Runtime::InteropServices::Out] long % value);
public static bool TryReadLittleEndian (this ref System.Buffers.SequenceReader<byte> reader, out long value);
static member TryReadLittleEndian : SequenceReader * int64 -> bool
<Extension()>
Public Function TryReadLittleEndian (ByRef reader As SequenceReader(Of Byte), ByRef value As Long) As Boolean

参数

reader
SequenceReader<Byte>

要从中读取值的字节序列读取器实例。The byte sequence reader instance from which the value is to be read.

value
Int64

当该方法返回时,作为小字节序从字节序列读取器读取的值。When the method returns, the value read out of the byte sequence reader, as little endian.

返回

Boolean

如果读取操作成功,则为 true;如果没有足够的数据用于 Int64,则为 falsetrue if the read operation is successful; false if there isn't enough data for an Int64.

适用于