public boolean findInList6 ( byte [ ] address ) { int len = address . length ; int a [ ] = new int [ len / 2 ] ; // IPv6, need to combine every two bytes to the ints int j = 0 ; int highOrder = 0 ; int lowOrder = 0 ; for ( int i = 0 ; i < len ; i += 2 ) { // convert possible negative byte value to positive int highOrder = address [ i ] & 0x00FF ; lowOrder = address [ i + 1 ] & 0x00FF ; a [ j ] = highOrder * 256 + lowOrder ; j ++ ; } return findInList ( a ) ; }
Determine if an IPv6 address represented by a byte array is in the address tree