BitSharp.Network.Messaging.BytesToIPAddress C# (CSharp) Method

BytesToIPAddress() public static method

public static BytesToIPAddress ( byte bytes ) : IPAddress
bytes byte
return System.Net.IPAddress
        public static IPAddress BytesToIPAddress(byte[] bytes)
        {
            var ipAddress = new IPAddress(bytes);
            if (ipAddress.IsIPv4MappedToIPv6)
                ipAddress = new IPAddress(bytes.Skip(12).ToArray());

            return ipAddress;
        }