L
Luke Skywalker
hi all 
I have to read a network packet, coded by a C program, where
the first two bytes codes the packet type, the following four
the packet length and then the payload. My problem is that the
lengths are integer coded (by the C program) into the network
order (using the htons() and htonl() functions). How can I perform
the decoding form Java? I.e. I read the first two byte:
int c1 = in.read();
int c2 = in.read();
How can I convert c1 and c1 into the packet length?
thanks in advance for ur reply !!!!!
I have to read a network packet, coded by a C program, where
the first two bytes codes the packet type, the following four
the packet length and then the payload. My problem is that the
lengths are integer coded (by the C program) into the network
order (using the htons() and htonl() functions). How can I perform
the decoding form Java? I.e. I read the first two byte:
int c1 = in.read();
int c2 = in.read();
How can I convert c1 and c1 into the packet length?
thanks in advance for ur reply !!!!!