question: public String convertBinaryToHexString ( byte [ ] bytes ) { StringBuilder builder = new StringBuilder ( bytes . length * 2 ) ; for ( byte b : bytes ) { int highBitsInt = ( b > > 4 ) & 0xF ; int lowBitsInt = b & 0xF ; builder . append ( HEX_CHARS [ highBitsInt ] ) ; builder . append ( HEX_CHARS [ lowBitsInt ] ) ; } return builder . toString ( ) ; }
target:  Convert the provided binary into a hex-string representation where each character represents 4 bits of the provided binary, i.e each byte requires two characters. <p> The returned hex characters are upper-case.