Table of Contents

Class EndianOptions

Namespace
Cuemon
Assembly
Cuemon.Kernel.dll

Configuration options for BitConverter.

public class EndianOptions : IParameterObject
Inheritance
EndianOptions
Implements
Derived

Examples

The following example demonstrates how to configure EndianOptions to explicitly set the byte order for binary data operations.

using System;
using Cuemon;

namespace MyApp.Examples;

public class EndianOptionsExample
{
    public void Demonstrate()
    {
        var options = new EndianOptions
        {
            ByteOrder = Endianness.BigEndian
        };

        var byteOrder = options.ByteOrder;
        var isSystemLittleEndian = BitConverter.IsLittleEndian;

        Console.WriteLine($"Configured byte order: {byteOrder}");
        Console.WriteLine($"System is little-endian: {isSystemLittleEndian}");

}
}

Constructors

EndianOptions()

Initializes a new instance of the EndianOptions class.

public EndianOptions()

Remarks

The following table shows the initial property values for an instance of EndianOptions.

PropertyInitial Value
ByteOrder
BitConverter.IsLittleEndian ? Endianness.LittleEndian : Endianness.BigEndian;

Properties

ByteOrder

Gets or sets the endian byte order enumeration.

public Endianness ByteOrder { get; set; }

Property Value

Endianness

The byte order enumeration.

See Also