code: public static String toHexa( byte [] bb ) {
          char[] HEXA_CHARS = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
          char[] ret = new char[bb.length*2];
          for(int i=0;i<bb.length;i++){
              ret[i*2] =HEXA_CHARS[((bb[i]& 0xF0) >> 4)];
              ret[i*2+1] = HEXA_CHARS[((bb[i] & 0x0F))];
          }
          return new String(ret);
      }
docs: Converts binary array into its hexadecimal representation.
  
  @param bb binary data
  @return hexadecimal string