OpenSim/Framework/Util.cs
/// <summary>
/// Converts a byte array in big endian order into an ulong.
/// </summary>
/// <param name="bytes">
/// The array of bytes
/// </param>
/// <returns>
/// The extracted ulong
/// </returns>
Converts a byte array in big endian order into an ulong.
Converts a byte array in big endian order into an ulong .
public static ulong BytesToUInt64Big(byte[] bytes)
        {
            if (bytes.Length < 8) return 0;
            return ((ulong)bytes[0] << 56) | ((ulong)bytes[1] << 48) | ((ulong)bytes[2] << 40) | ((ulong)bytes[3] << 32) |
                ((ulong)bytes[4] << 24) | ((ulong)bytes[5] << 16) | ((ulong)bytes[6] << 8) | (ulong)bytes[7];
        }
public static ulong BytesToUInt64Big ( byte [ ] bytes ) { if ( bytes . Length < 8 ) return 0 ; return ( ( ulong ) bytes [ 0 ] << 56 ) | ( ( ulong ) bytes [ 1 ] << 48 ) | ( ( ulong ) bytes [ 2 ] << 40 ) | ( ( ulong ) bytes [ 3 ] << 32 ) | ( ( ulong ) bytes [ 4 ] << 24 ) | ( ( ulong ) bytes [ 5 ] << 16 ) | ( ( ulong ) bytes [ 6 ] << 8 ) | ( ulong ) bytes [ 7 ] ; }
Converts a byte array in big endian order into an ulong.
Converts a byte array in big endian order into an ulong .
The extracted ulong
The extracted ulong
bytes
byte[]
The array of bytes
The array of bytes