How to convert Byte array to unsigned int ?
HurukanNov 24 2010 — edited Nov 24 2010Greetings,
I've no particular knowledge in Java programming and I've an issue with a conversion.
The exception thrown is "Number Format Exception For input string: "249" when I execute the following code:
readbytes=SocketInput.read(bMessage);
NetMessage=new String(bMessage);
NetMessage=NetMessage.substring(0,readbytes);
if(NetMessage.equals("NORES"))
NetMessage="0";
int res=0;
try
{
res=Byte.valueOf(NetMessage);
}
catch(NumberFormatException nfe)
{
AddMessage("Number Format Exception "+nfe.getMessage()+"["+bMessage.toString()+"]");
}