Java IP Address Convert To convertIpPortToUniqueId(byte[] quad, int port)

Here you can find the source of convertIpPortToUniqueId(byte[] quad, int port)

Description

convert Ip Port To Unique Id

License

Apache License

Declaration

public static long convertIpPortToUniqueId(byte[] quad, int port) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static long convertIpPortToUniqueId(byte[] quad, int port) {
        return (((long) port) << 32 | ((long) (quad[0] & 0xFF)) << 24 | ((long) (quad[1] & 0xFF)) << 16
                | ((long) (quad[2] & 0xFF)) << 8 | ((long) (quad[3] & 0xFF)));
    }//  w ww .jav a2s .  c om
}

Related

  1. convertIp(String ip)
  2. convertIP6Address(byte[] bytes)
  3. convertIPAdressToBytes(String ip)
  4. convertIpv4Address(String ip)
  5. convertIpv4AddressToString(byte[] ipv4Address)
  6. convertIPv4NetworkPrefixLength(short length)
  7. convertIpv4ToIpv6(String ip)