Hi
I'm working on a project where a lot of data processing isn't done on the NXT, but on a remote PC.
At the moment I succesfully established a BT connection between the NXT and my remote program. Now I have a few questions about the data exchange, especially the byte order.
I'm using a java.io.DataOutputStream to send the first integer value of my protocoll header to the PC, a simple "1" at the moment, and receive a 16777216 when I call readInt() on my remote DataInputStream.
16777216 is 01000000 in hex, so it looks like the program on the NXT uses Little Endian. Am I right?
That's confusing, because I always thought Java uses Big Endian on every platform.
Now I could simply convert the 4 bytes to network byte order on the next by hand, but I wonder if there isn't a more elegant way to do it.
Is there some OutputStream that automatically converts data to network byte order?
I also stumbled upon a build.xml in the net, which included a parameter for the "endian-ess". So is it possible to compile my next program in a way that big endian is used instead of little endian? (with Eclipse)
Sorry for beeing so detailed, but I hope to be not the only dumb person struggling with this topic, and so the search engine of this site has a little to spit out in the future.
