C# Class 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.
Afficher le fichier Open project: ME3Explorer/ME3Explorer Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

BetweenBuffers() public méthode

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
Résultat void

Convert() public méthode

Converts data to the target Endian format.
public Convert ( char data ) : char
data char
Résultat char

Convert() public méthode

Converts data to the target Endian format.
public Convert ( double data ) : double
data double
Résultat double

Convert() public méthode

Converts data to the target Endian format.
public Convert ( float data ) : float
data float
Résultat float

Convert() public méthode

Converts data to the target Endian format.
public Convert ( int data ) : int
data int
Résultat int

Convert() public méthode

Converts data to the target Endian format.
public Convert ( long data ) : long
data long
Résultat long

Convert() public méthode

Converts data to the target Endian format.
public Convert ( short data ) : short
data short
Résultat short

Convert() public méthode

Converts data to the target Endian format.
public Convert ( uint data ) : uint
data uint
Résultat uint

Convert() public méthode

Converts data to the target Endian format.
public Convert ( ulong data ) : ulong
data ulong
Résultat ulong

Convert() public méthode

Converts data to the target Endian format.
public Convert ( ushort data ) : ushort
data ushort
Résultat ushort

Create() public static méthode

Creates a converter based on whether the data needs to be converted or simply copied.
public static Create ( bool convert ) : EndianConverter
convert bool
Résultat EndianConverter

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToBytes() public méthode

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
Résultat void

ToChar() public méthode

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
Résultat char

ToDouble() public méthode

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
Résultat double

ToInt16() public méthode

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
Résultat short

ToInt32() public méthode

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
Résultat int

ToInt64() public méthode

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
Résultat long

ToSingle() public méthode

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
Résultat float

ToUInt16() public méthode

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
Résultat ushort

ToUInt32() public méthode

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
Résultat uint

ToUInt64() public méthode

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
Résultat ulong