C# Класс Gammtek.Conduit.IO.Converters.EndianConverter

Provides the conversion functionality between two Endian types. This is either a straight-through copy if the Endian settings are the same or a conversion routine reversing the bytes.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BetweenBuffers ( byte destination, int dstIndex, byte source, int srcIndex, int count ) : void

Performs either a copy or byte order reversal from the source to the destination for count bytes based on the conversion settings.

Convert ( char data ) : char

Converts data to the target Endian format.

Convert ( double data ) : double

Converts data to the target Endian format.

Convert ( float data ) : float

Converts data to the target Endian format.

Convert ( int data ) : int

Converts data to the target Endian format.

Convert ( long data ) : long

Converts data to the target Endian format.

Convert ( short data ) : short

Converts data to the target Endian format.

Convert ( uint data ) : uint

Converts data to the target Endian format.

Convert ( ulong data ) : ulong

Converts data to the target Endian format.

Convert ( ushort data ) : ushort

Converts data to the target Endian format.

Create ( bool convert ) : EndianConverter

Creates a converter based on whether the data needs to be converted or simply copied.

ToBytes ( char data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( double data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( float data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( int data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( long data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( short data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( uint data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( ulong data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToBytes ( ushort data, byte destination, int index ) : void

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.

ToChar ( byte data, int index ) : char

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToDouble ( byte data, int index ) : double

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToInt16 ( byte data, int index ) : short

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToInt32 ( byte data, int index ) : int

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToInt64 ( byte data, int index ) : long

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToSingle ( byte data, int index ) : float

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToUInt16 ( byte data, int index ) : ushort

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToUInt32 ( byte data, int index ) : uint

Returns the type from data starting at index in the correct byte order based on the conversion settings.

ToUInt64 ( byte data, int index ) : ulong

Returns the type from data starting at index in the correct byte order based on the conversion settings.

Приватные методы

Метод Описание
CopyLinear ( byte dst, byte src, int count ) : void
CopyReverse ( byte dst, byte src, int count ) : void
EndianConverter ( ) : System
EndianConverter ( RawCopierDelegate copier ) : System
SafeCopier ( byte dst, int dstSize, byte src, int srcSize, int count ) : void

Описание методов

BetweenBuffers() публичный Метод

Performs either a copy or byte order reversal from the source to the destination for count bytes based on the conversion settings.
public BetweenBuffers ( byte destination, int dstIndex, byte source, int srcIndex, int count ) : void
destination byte
dstIndex int
source byte
srcIndex int
count int
Результат void

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( char data ) : char
data char
Результат char

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( double data ) : double
data double
Результат double

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( float data ) : float
data float
Результат float

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( int data ) : int
data int
Результат int

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( long data ) : long
data long
Результат long

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( short data ) : short
data short
Результат short

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( uint data ) : uint
data uint
Результат uint

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( ulong data ) : ulong
data ulong
Результат ulong

Convert() публичный Метод

Converts data to the target Endian format.
public Convert ( ushort data ) : ushort
data ushort
Результат ushort

Create() публичный статический Метод

Creates a converter based on whether the data needs to be converted or simply copied.
public static Create ( bool convert ) : EndianConverter
convert bool
Результат EndianConverter

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( char data, byte destination, int index ) : void
data char
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( double data, byte destination, int index ) : void
data double
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( float data, byte destination, int index ) : void
data float
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( int data, byte destination, int index ) : void
data int
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( long data, byte destination, int index ) : void
data long
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( short data, byte destination, int index ) : void
data short
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( uint data, byte destination, int index ) : void
data uint
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( ulong data, byte destination, int index ) : void
data ulong
destination byte
index int
Результат void

ToBytes() публичный Метод

Copies the bytes from data to destination starting at index either linearly or reversed based on the conversion settings.
public ToBytes ( ushort data, byte destination, int index ) : void
data ushort
destination byte
index int
Результат void

ToChar() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToChar ( byte data, int index ) : char
data byte
index int
Результат char

ToDouble() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToDouble ( byte data, int index ) : double
data byte
index int
Результат double

ToInt16() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToInt16 ( byte data, int index ) : short
data byte
index int
Результат short

ToInt32() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToInt32 ( byte data, int index ) : int
data byte
index int
Результат int

ToInt64() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToInt64 ( byte data, int index ) : long
data byte
index int
Результат long

ToSingle() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToSingle ( byte data, int index ) : float
data byte
index int
Результат float

ToUInt16() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToUInt16 ( byte data, int index ) : ushort
data byte
index int
Результат ushort

ToUInt32() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToUInt32 ( byte data, int index ) : uint
data byte
index int
Результат uint

ToUInt64() публичный Метод

Returns the type from data starting at index in the correct byte order based on the conversion settings.
public ToUInt64 ( byte data, int index ) : ulong
data byte
index int
Результат ulong