Class DataReader
- Namespace
- nanoFramework.Device.Bluetooth
- Assembly
- nanoFramework.Device.Bluetooth.dll
Reads data from an input buffer.
public class DataReader
- Inheritance
-
DataReader
- Inherited Members
- Extension Methods
Properties
UnconsumedBufferLength
Gets the size of the buffer that has not been read.
public uint UnconsumedBufferLength { get; }
Property Value
- uint
The size of the buffer that has not been read, in bytes.
Methods
FromBuffer(Buffer)
Creates a new instance of the data reader with data from the specified buffer.
public static DataReader FromBuffer(Buffer buffer)
Parameters
buffer
BufferThe buffer.
Returns
- DataReader
The data reader.
ReadBoolean()
Reads a Boolean value from the input buffer.
public bool ReadBoolean()
Returns
- bool
The value.
ReadBuffer(uint)
Reads a buffer from the input buffer.
public Buffer ReadBuffer(uint length)
Parameters
length
uintThe length of the buffer, in bytes.
Returns
- Buffer
The buffer.
ReadByte()
Reads a byte value from the input buffer.
public byte ReadByte()
Returns
- byte
The value.
ReadBytes(byte[])
Reads an array of byte values from the input buffer.
public void ReadBytes(byte[] value)
Parameters
value
byte[]The array of values.
ReadDateTime()
Reads a date and time value from the input buffer.
public DateTime ReadDateTime()
Returns
- DateTime
The value.
ReadDouble()
Reads a floating-point value from the input buffer.
public double ReadDouble()
Returns
- double
The value.
ReadGuid()
Reads a Guid value from the input buffer.
public Guid ReadGuid()
Returns
- Guid
The value.
ReadInt16()
Reads a 16-bit integer value from the input buffer.
public short ReadInt16()
Returns
- short
The value.
ReadInt32()
Reads a 32-bit integer value from the input buffer.
public int ReadInt32()
Returns
- int
The value.
ReadInt64()
Reads a 64-bit integer value from the input buffer.
public long ReadInt64()
Returns
- long
The value.
ReadSingle()
Reads a floating-point value from the input buffer.
public float ReadSingle()
Returns
- float
The value.
ReadString(uint)
Reads a string value from the input buffer.
public string ReadString(uint codeUnitCount)
Parameters
codeUnitCount
uintThe length of the string.
Returns
- string
The value.
ReadTimeSpan()
Reads a time interval from the input buffer.
public TimeSpan ReadTimeSpan()
Returns
- TimeSpan
The value.
ReadUInt16()
Reads a 16-bit unsigned integer from the input buffer.
public ushort ReadUInt16()
Returns
- ushort
The value.
ReadUInt32()
Reads a 32-bit unsigned integer from the input buffer.
public uint ReadUInt32()
Returns
- uint
The value.
ReadUInt64()
Reads a 64-bit unsigned integer from the input buffer.
public ulong ReadUInt64()
Returns
- ulong
The value.
ReadUuid()
Reads a UUID value from the input buffer.
public Guid ReadUuid()
Returns
- Guid
The UUID value.
ReadUuid2()
Reads a UUID value from the input buffer which has been written with WriteUuid2(Guid).
public Guid ReadUuid2()
Returns
- Guid
The GUID/UUID value.