public static String alphaStrToHexStr(String msgStr){
  StringBuffer result=new StringBuffer();
  for (int ofs=0; ofs < msgStr.length(); ofs++) {
    result.append(String.format("%02x",msgStr.charAt(ofs)));
  }
  return (result.toString());
}

public static String alphaStrToHexStr ( String msgStr ) { StringBuffer result = new StringBuffer ( ) ; for ( int ofs = 0 ; ofs < msgStr . length ( ) ; ofs ++ ) { result . append ( String . format ( "%02x" , msgStr . charAt ( ofs ) ) ) ; } return ( result . toString ( ) ) ; }
return hex - dump from string
