public static String byte2HexString(byte[] bytes)
{
String hs="";
String stmp="";
for (int n=0;n<bytes.length;n++) {
stmp=(Integer.toHexString(bytes[n] & 0XFF));
if (stmp.length()==1)
{
hs=hs+"0"+stmp;
}
else
{
hs=hs+stmp;
}
}
return hs.toUpperCase();
}