Table of Contents

Class BigEndianBitConverter

Namespace
SunamoConverters.Converts
Assembly
SunamoConverters.dll

Provides methods for converting values to big-endian byte arrays and vice versa.

public static class BigEndianBitConverter
Inheritance
BigEndianBitConverter
Inherited Members

Methods

GetBytes(ushort)

Converts an unsigned 16-bit integer to a big-endian byte array.

public static byte[] GetBytes(ushort value)

Parameters

value ushort

The value to convert.

Returns

byte[]

A byte array in big-endian format.

GetBytes(uint)

Converts an unsigned 32-bit integer to a big-endian byte array.

public static byte[] GetBytes(uint value)

Parameters

value uint

The value to convert.

Returns

byte[]

A byte array in big-endian format.

GetBytes(ulong)

Converts an unsigned 64-bit integer to a big-endian byte array.

public static byte[] GetBytes(ulong value)

Parameters

value ulong

The value to convert.

Returns

byte[]

A byte array in big-endian format.

ToUInt16(byte[], int)

Converts a big-endian byte array to an unsigned 16-bit integer.

public static ushort ToUInt16(byte[] value, int startIndex)

Parameters

value byte[]

The byte array to convert.

startIndex int

The starting position within the array.

Returns

ushort

An unsigned 16-bit integer.

ToUInt32(byte[], int)

Converts a big-endian byte array to an unsigned 32-bit integer.

public static uint ToUInt32(byte[] value, int startIndex)

Parameters

value byte[]

The byte array to convert.

startIndex int

The starting position within the array.

Returns

uint

An unsigned 32-bit integer.

ToUInt64(byte[], int)

Converts a big-endian byte array to an unsigned 64-bit integer.

public static ulong ToUInt64(byte[] value, int startIndex)

Parameters

value byte[]

The byte array to convert.

startIndex int

The starting position within the array.

Returns

ulong

An unsigned 64-bit integer.