Table of Contents

Class CdrReader

Namespace
Pamoja.Ros2
Assembly
Pamoja.Ros2.dll

A CDR decoder, which reads primitives back in the order written.

public sealed class CdrReader : IDisposable
Inheritance
CdrReader
Implements
Inherited Members

Remarks

Reading past the end returns null rather than throwing, because a short buffer is a wire condition rather than a programming error.

Constructors

CdrReader(ReadOnlySpan<byte>)

Creates a decoder over encoded bytes.

public CdrReader(ReadOnlySpan<byte> data)

Parameters

data ReadOnlySpan<byte>

The encoded bytes.

Exceptions

PamojaException

The bytes carry no valid CDR encapsulation header.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ReadDouble()

Reads the next 64-bit float.

public double? ReadDouble()

Returns

double?

The value, or null once exhausted.

ReadInt32()

Reads the next 32-bit signed integer.

public int? ReadInt32()

Returns

int?

The value, or null once exhausted.

ReadSingle()

Reads the next 32-bit float.

public float? ReadSingle()

Returns

float?

The value, or null once exhausted.

ReadUInt32()

Reads the next 32-bit unsigned integer.

public uint? ReadUInt32()

Returns

uint?

The value, or null once exhausted.