Table of Contents

Class MessageReader

Namespace
QuickLink.Messaging
Assembly
QuickLink.dll

Represents a reader for reading messages from a byte buffer.

public class MessageReader
Inheritance
MessageReader
Inherited Members

Constructors

Initializes a new instance of the MessageReader class with the specified buffer.

public MessageReader(byte[] buffer)

Parameters

buffer byte[]

The byte buffer to read from.

Properties

Gets the type of the message being read.

public MessageType Type { get; }

Property Value

MessageType

Methods

Reads a boolean from the buffer.

public bool ReadBool()

Returns

bool

The boolean read from the buffer

Reads a byte from the buffer.

public byte ReadByte()

Returns

byte

The byte read from the buffer

Writes the specified amount of bytes to the provided buffer.

public void ReadBytes(byte[] buffer, int offset, int length)

Parameters

buffer byte[]

The buffer to write the bytes to.

offset int

The offset at which to write the bytes in the output buffer.

length int

The amount of bytes to write to the buffer.

Reads a 32-bit signed double from the buffer.

public double ReadDouble()

Returns

double

The double read from the buffer.

Reads a 32-bit signed float from the buffer.

public float ReadFloat()

Returns

float

The float read from the buffer.

Reads a 16-bit signed integer from the buffer.

public int ReadInt16()

Returns

int

The 16-bit signed integer read from the buffer.

Reads a 32-bit signed integer from the buffer.

public int ReadInt32()

Returns

int

The 32-bit signed integer read from the buffer.

Reads a string from the buffer.

public string ReadString()

Returns

string

The string read from the buffer.

Reads a 16-bit unsigned integer from the buffer.

public uint ReadUInt16()

Returns

uint

The 16-bit unsigned integer read from the buffer.

Reads a 32-bit unsigned integer from the buffer.

public uint ReadUInt32()

Returns

uint

The 32-bit unsigned integer read from the buffer.

Sets the current position in the buffer to the specified offset.

public void Seek(int offset)

Parameters

offset int

The offset to seek to.

Creates a new MessageWriter instance with the same message type as this reader.

public MessageWriter ToWriter()

Returns

MessageWriter

A new MessageWriter instance.