akifusenet / gmail.com wrote:
> First question, how can I change network to host byte order? ( like
> ntoh?)
> And then how can i put this byte stream into  a struct or smtg else.
> (The real aim is getting x,y,z quickly)

The suggestions to use pack and unpack are right on target, and learning 
how to use them will be very valuable. At some point, you may want to 
have a way of declaratively working with binary data structures, and 
there are a couple of libraries that can help with that:

binaryparse (available as gem)

bindata (ditto)

bitstruct (my own library, not a gem: 
http://raa.ruby-lang.org/project/bit-struct)

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407