I'm trying to convert byte array which holds hex values.
byte[] bytes = {48, 48, 48, 48, 48, 51, 51, 99}
for example : 48, 48, 48, 48, 48, 51, 51, 99 is 0000033c and converted to int is 828. The only way to convert is converting it to String and then parse integer from String.
public static int ConvertValueFromBytes(byte[] bytes)
{
String b = new String(bytes);
return Converter.ConvertHexToInt(b);
}
The main problem here is performance, calling it many times can cause performance issues. When trying parse int value from byte array I get massive numbers, thats why I'm parsing from String, to get the correct value. Is there a better way or solution to this ?