public static long addressToLong ( InetAddress address ) { long result = 0 ; for ( byte element : address . getAddress ( ) ) { result = ( result << 8 ) + unsign ( element ) ; } return result ; }
Converts the bytes that make up an internet address into the corresponding integer value to make it easier to perform bit - masking operations on them .