Table of Contents

Struct Endian

Namespace
FellowOakDicom.IO
Assembly
fo-dicom.core.dll

Representation and convenience methods associated with endianness.

public struct Endian
Inherited Members
Extension Methods

Fields

Big

Big endian.

public static readonly Endian Big

Field Value

Endian

Little

Little endian.

public static readonly Endian Little

Field Value

Endian

LocalMachine

Endianness of the local machine, according to IsLittleEndian.

public static readonly Endian LocalMachine

Field Value

Endian

Network

Network endian (big).

public static readonly Endian Network

Field Value

Endian

Methods

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Swap(double)

Swap byte order in double value.

public static double Swap(double value)

Parameters

value double

Value in which bytes should be swapped.

Returns

double

Byte order swapped value.

Swap(short)

Swap byte order in short value.

public static short Swap(short value)

Parameters

value short

Value in which bytes should be swapped.

Returns

short

Byte order swapped value.

Swap(short[])

Swap byte order in array of short values.

public static void Swap(short[] values)

Parameters

values short[]

Array of short values.

Swap(int)

Swap byte order in int value.

public static int Swap(int value)

Parameters

value int

Value in which bytes should be swapped.

Returns

int

Byte order swapped value.

Swap(int[])

Swap byte order in array of int values.

public static void Swap(int[] values)

Parameters

values int[]

Array of int values.

Swap(long)

Swap byte order in long value.

public static long Swap(long value)

Parameters

value long

Value in which bytes should be swapped.

Returns

long

Byte order swapped value.

Swap(float)

Swap byte order in float value.

public static float Swap(float value)

Parameters

value float

Value in which bytes should be swapped.

Returns

float

Byte order swapped value.

Swap(ushort)

Swap byte order in ushort value.

public static ushort Swap(ushort value)

Parameters

value ushort

Value in which bytes should be swapped.

Returns

ushort

Byte order swapped value.

Swap(ushort[])

Swap byte order in array of ushort values.

public static void Swap(ushort[] values)

Parameters

values ushort[]

Array of ushort values.

Swap(uint)

Swap byte order in uint value.

public static uint Swap(uint value)

Parameters

value uint

Value in which bytes should be swapped.

Returns

uint

Byte order swapped value.

Swap(uint[])

Swap byte order in array of uint values.

public static void Swap(uint[] values)

Parameters

values uint[]

Array of uint values.

Swap(ulong)

Swap byte order in ulong value.

public static ulong Swap(ulong value)

Parameters

value ulong

Value in which bytes should be swapped.

Returns

ulong

Byte order swapped value.

SwapBytes(int, byte[])

Swap bytes in sequences of bytesToSwap.

public static void SwapBytes(int bytesToSwap, byte[] bytes)

Parameters

bytesToSwap int

Number of bytes to swap.

bytes byte[]

Array of bytes.

SwapBytes(int, byte[], int)

Swap bytes in sequences of bytesToSwap.

public static void SwapBytes(int bytesToSwap, byte[] bytes, int count)

Parameters

bytesToSwap int

Number of bytes to swap.

bytes byte[]

Array of bytes.

count int

The maximum number of bytes in the array that should be processed

SwapBytes2(byte[])

Swap bytes in sequences of 2.

public static void SwapBytes2(byte[] bytes)

Parameters

bytes byte[]

Array of bytes.

SwapBytes2(byte[], int)

Swap bytes in sequences of 2.

public static void SwapBytes2(byte[] bytes, int count)

Parameters

bytes byte[]

Array of bytes.

count int

The maximum number of bytes in the array that should be processed

SwapBytes4(byte[])

Swap bytes in sequences of 4.

public static void SwapBytes4(byte[] bytes)

Parameters

bytes byte[]

Array of bytes.

SwapBytes4(byte[], int)

Swap bytes in sequences of 4.

public static void SwapBytes4(byte[] bytes, int count)

Parameters

bytes byte[]

Array of bytes.

count int

The maximum number of bytes in the array that should be processed

Swap<T>(T[])

Swap byte order in array of values.

public static void Swap<T>(T[] values)

Parameters

values T[]

Array of values to swap.

Type Parameters

T

Array element type, must be one of short, ushort, int or uint.

Exceptions

InvalidOperationException

if array element type is not short, ushort, int or uint.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(Endian, Endian)

Endian equivalence operator.

public static bool operator ==(Endian e1, Endian e2)

Parameters

e1 Endian

First Endian object.

e2 Endian

Second Endian object.

Returns

bool

True if e1 equals e2, false otherwise.

operator !=(Endian, Endian)

Endian non-equivalence operator.

public static bool operator !=(Endian e1, Endian e2)

Parameters

e1 Endian

First Endian object.

e2 Endian

Second Endian object.

Returns

bool

True if e1 does not equal e2, false otherwise.