Apache.NMS.Util.EndianSupport.SwitchEndian C# (CSharp) Method

SwitchEndian() public static method

public static SwitchEndian ( byte x ) : byte[]
x byte
return byte[]
        public static byte[] SwitchEndian(byte[] x)
        {
            byte[] rc = new byte[x.Length];
            int j = x.Length-1;
            for(int i=0; i < x.Length; i++ ) {
                rc[i] = x[j];
                j--;
            }
            return rc;
        }

Same methods

EndianSupport::SwitchEndian ( char x ) : char
EndianSupport::SwitchEndian ( double x ) : double
EndianSupport::SwitchEndian ( float x ) : float
EndianSupport::SwitchEndian ( int x ) : int
EndianSupport::SwitchEndian ( long x ) : long
EndianSupport::SwitchEndian ( short x ) : short
EndianSupport::SwitchEndian ( uint x ) : uint
EndianSupport::SwitchEndian ( ulong x ) : ulong
EndianSupport::SwitchEndian ( ushort x ) : ushort

Usage Example

Beispiel #1
0
 /// <summary>
 /// Method ReadInt16
 /// </summary>
 /// <returns>A short</returns>
 public override short ReadInt16()
 {
     return(EndianSupport.SwitchEndian(base.ReadInt16()));
 }
All Usage Examples Of Apache.NMS.Util.EndianSupport::SwitchEndian
EndianSupport