question: public static String arrayToHexString ( byte [ ] array , int offset , int limit ) { String retVal ; if ( array != null ) { StringBuffer hexString = new StringBuffer ( array . length ) ; int hexVal ; char hexChar ; int length = Math . min ( limit , array . length ) ; for ( int i = offset ; i < length ; i ++ ) { hexVal = ( array [ i ] & 0xF0 ) > > 4 ; hexChar = ( char ) ( ( hexVal > 9 ) ? ( 'A' + ( hexVal - 10 ) ) : ( '0' + hexVal ) ) ; hexString . append ( hexChar ) ; hexVal = array [ i ] & 0x0F ; hexChar = ( char ) ( ( hexVal > 9 ) ? ( 'A' + ( hexVal - 10 ) ) : ( '0' + hexVal ) ) ; hexString . append ( hexChar ) ; } retVal = hexString . toString ( ) ; } else { retVal = "<null>" ; } return retVal ; }
target:  Helper method to convert a byte[] array (such as a MsgId) to a hex string