Struct Endian
Representation and convenience methods associated with endianness.
Inherited Members
Namespace: Dicom.IO
Assembly: cs.temp.dll.dll
Syntax
public struct Endian
Fields
Big
Big endian.
Declaration
public static readonly Endian Big
Field Value
Type | Description |
---|---|
Endian |
Little
Little endian.
Declaration
public static readonly Endian Little
Field Value
Type | Description |
---|---|
Endian |
LocalMachine
Endianness of the local machine, according to IsLittleEndian.
Declaration
public static readonly Endian LocalMachine
Field Value
Type | Description |
---|---|
Endian |
Network
Network endian (big).
Declaration
public static readonly Endian Network
Field Value
Type | Description |
---|---|
Endian |
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
Swap(Double)
Swap byte order in Double value.
Declaration
public static double Swap(double value)
Parameters
Type | Name | Description |
---|---|---|
Double | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
Double | Byte order swapped value. |
Swap(Int16)
Swap byte order in Int16 value.
Declaration
public static short Swap(short value)
Parameters
Type | Name | Description |
---|---|---|
Int16 | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
Int16 | Byte order swapped value. |
Swap(Int16[])
Swap byte order in array of Int16 values.
Declaration
public static void Swap(short[] values)
Parameters
Type | Name | Description |
---|---|---|
Int16[] | values | Array of Int16 values. |
Swap(Int32)
Swap byte order in Int32 value.
Declaration
public static int Swap(int value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
Int32 | Byte order swapped value. |
Swap(Int32[])
Swap byte order in array of Int32 values.
Declaration
public static void Swap(int[] values)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | values | Array of Int32 values. |
Swap(Int64)
Swap byte order in Int64 value.
Declaration
public static long Swap(long value)
Parameters
Type | Name | Description |
---|---|---|
Int64 | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
Int64 | Byte order swapped value. |
Swap(Single)
Swap byte order in Single value.
Declaration
public static float Swap(float value)
Parameters
Type | Name | Description |
---|---|---|
Single | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
Single | Byte order swapped value. |
Swap(UInt16)
Swap byte order in UInt16 value.
Declaration
public static ushort Swap(ushort value)
Parameters
Type | Name | Description |
---|---|---|
UInt16 | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
UInt16 | Byte order swapped value. |
Swap(UInt16[])
Swap byte order in array of UInt16 values.
Declaration
public static void Swap(ushort[] values)
Parameters
Type | Name | Description |
---|---|---|
UInt16[] | values | Array of UInt16 values. |
Swap(UInt32)
Swap byte order in UInt32 value.
Declaration
public static uint Swap(uint value)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
UInt32 | Byte order swapped value. |
Swap(UInt32[])
Swap byte order in array of UInt32 values.
Declaration
public static void Swap(uint[] values)
Parameters
Type | Name | Description |
---|---|---|
UInt32[] | values | Array of UInt32 values. |
Swap(UInt64)
Swap byte order in UInt64 value.
Declaration
public static ulong Swap(ulong value)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | value | Value in which bytes should be swapped. |
Returns
Type | Description |
---|---|
UInt64 | Byte order swapped value. |
Swap<T>(T[])
Swap byte order in array of values.
Declaration
public static void Swap<T>(T[] values)
Parameters
Type | Name | Description |
---|---|---|
T[] | values | Array of values to swap. |
Type Parameters
Name | Description |
---|---|
T | Array element type, must be one of Int16, UInt16, Int32 or UInt32. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | if array element type is not Int16, UInt16, Int32 or UInt32. |
SwapBytes(Int32, Byte[])
Swap bytes in sequences of bytesToSwap
.
Declaration
public static void SwapBytes(int bytesToSwap, byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Int32 | bytesToSwap | Number of bytes to swap. |
Byte[] | bytes | Array of bytes. |
SwapBytes2(Byte[])
Swap bytes in sequences of 2.
Declaration
public static void SwapBytes2(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | Array of bytes. |
SwapBytes4(Byte[])
Swap bytes in sequences of 4.
Declaration
public static void SwapBytes4(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | Array of bytes. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Operators
Equality(Endian, Endian)
Endian equivalence operator.
Declaration
public static bool operator ==(Endian e1, Endian e2)
Parameters
Type | Name | Description |
---|---|---|
Endian | e1 | First Endian object. |
Endian | e2 | Second Endian object. |
Returns
Type | Description |
---|---|
Boolean | True if |
Inequality(Endian, Endian)
Endian non-equivalence operator.
Declaration
public static bool operator !=(Endian e1, Endian e2)
Parameters
Type | Name | Description |
---|---|---|
Endian | e1 | First Endian object. |
Endian | e2 | Second Endian object. |
Returns
Type | Description |
---|---|
Boolean | True if |