private static String hexify(byte bytes[]){
  char[] hexDigits={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
  StringBuffer buf=new StringBuffer(bytes.length * 2);
  for (int i=0; i < bytes.length; ++i) {
    if (i != 0) {
      buf.append(":");
    }
    buf.append(hexDigits[(bytes[i] & 0xf0) >> 4]);
    buf.append(hexDigits[bytes[i] & 0x0f]);
  }
  return buf.toString();
}

private static String hexify ( byte bytes [ ] ) { char [ ] hexDigits = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' } ; StringBuffer buf = new StringBuffer ( bytes . length * 2 ) ; for ( int i = 0 ; i < bytes . length ; ++ i ) { if ( i != 0 ) { buf . append ( ":" ) ; } buf . append ( hexDigits [ ( bytes [ i ] & 0xf0 ) > > 4 ] ) ; buf . append ( hexDigits [ bytes [ i ] & 0x0f ] ) ; } return buf . toString ( ) ; }
hexify a byte array
