i m new to java. i want to convert a byte array of decimal value to hexadecimal string. my input byte array is [0, 0, 0, 0, 0, 0, 1, -28]. i m getting 00000000000001e4 instead of 0000001e4. plz help me to solve this problem
public static String ConvetToHex(byte[] decValue)
{
String value = "";
for(int i = 0;i<decValue.length;i++)
{
value = value+ Integer.toString((decValue[i] & 0xff) + 0x100, 16).substring(1);
}
return value;
}