Int16 - NetworkToHostOrder
Converts a short value from network byte order to host byte order.
public static void Main() { Int16 input = 57; // C# Extension Method: Int16 - NetworkToHostOrder Int16 output = input.NetworkToHostOrder(); Console.WriteLine("val = {0}, output = {1}", input, output); }
View Source
using System; using System.Net; public static partial class Extensions { /// <summary> /// Converts a short value from network byte order to host byte order. /// </summary> /// <param name="network">The number to convert, expressed in network byte order.</param> /// <returns>A short value, expressed in host byte order.</returns> public static Int16 NetworkToHostOrder(this Int16 network) { return IPAddress.NetworkToHostOrder(network); } }