I am working on a project involving a java server and a gps device. The java server is very simple, it opens a new server socket and waits for the device to connect. the device connects but here's my problem. When the device connects it sends a hex message like so: 0xD0 0xD7 0x1A 0x01 0xC7 0x54 0x44 0x3C, and i must reply to the device with the following hex message: 0xD7D0. So the device connects to a socket, and after connecting the first thing that he does is to send the hex message: 0xD0 0xD7 0x1A 0x01 0xC7 0x54 0x44 0x3C. After that it waits for my reply.

I have tried to recive the hex message into a byte array with no success. I am new to java so can you give me any ideeas?

Thank you!