private static int decodeNibbles ( final char c1 , final char c2 ) { final int n1 = decodeHex ( c1 ) ; if ( n1 == INVALID ) { return INVALID ; } final int n2 = decodeHex ( c2 ) ; if ( n2 == INVALID ) { return INVALID ; } return ( ( ( n1 & 0xf ) << 4 ) | ( n2 & 0xf ) ) ; }
Decode two hex nibbles to a byte . E . g . 3 and F - > 63 .