sending Chararray of hexadecimal
Hi everyone.
im trying to send a chararray of hexadecimal in a socket, but when i catch it on the server it's not the same chararray...
this is the array i am sending from the client:
char[] _envio ={0x00,0x4C,0x60,0x00,0x05,0x80,0xE3,0x08,0x00,0x20,0x20,0x61,0x01,0x80,0xC0,0x00,0x02,
0x95,0x00,0x00,0x01,0x05,0x82,0x12,0x34,0x01,0x23,0x00,0x01};
and this is what i am getting on the server:
0 4C 60 05 3F E3 8 0 20 20 61 1 3F C0 02 3F 0 0 15 3F12 34 1 23 01
note that the problem is when the hexadecimal is 0x80, 0x95 and 0x82 it is always change by 3F...
can someone tell me why this is happening?
this is how i am sending the chararray
char[] _envio ={0x00,0x4C,0x60,0x00,0x05,0x80,0xE3,0x08,0x00,0x20,0x20,0x61,0x01,0x80,0xC0,0x00,0x02,
0x95,0x00,0x00,0x01,0x05,0x82,0x12,0x34,0x01,0x23,0x00,0x01};
try
{
_serversocket =new Socket(_ipserver, _portserver);
_out =new PrintStream(_serversocket.getOutputStream());
_in =new BufferedReader(new InputStreamReader(
_serversocket.getInputStream()));
_out.println(_envio);
}
catch (UnknownHostException ex)
{
ex.printStackTrace();
}
and this is how i am chatching it in the server
try
{
_in =new BufferedReader(new InputStreamReader(
_clientsocket.getInputStream()));
_out =new PrintStream(_clientsocket.getOutputStream());
_in.read(_msj);
System.out.print("Mensaje del cliente: ");
for(int i = 0; i < _msj.length; i++)
{
System.out.print(Integer.toHexString((int)_msj[i]).toUpperCase());
}
System.out.println();
}
catch (IOException ex)
{
ex.printStackTrace();
}

