/// <summary>Converts a long value from network byte order to host byte order.</summary> /// <returns>A long value, expressed in host byte order.</returns> /// <param name="network">The number to convert, expressed in network byte order. </param> public static long NetworkToHostOrder(long network) { if (!BitConverter.IsLittleEndian) { return(network); } return(IPAddress.SwapLong(network)); }
/// <summary>Converts a long value from host byte order to network byte order.</summary> /// <returns>A long value, expressed in network byte order.</returns> /// <param name="host">The number to convert, expressed in host byte order. </param> public static long HostToNetworkOrder(long host) { if (!BitConverter.IsLittleEndian) { return(host); } return(IPAddress.SwapLong(host)); }