From: Jason Voegele Date: 2002-04-13T02:02:25+09:00 Subject: Re: Array#pack: byte order for unsigned types > In message "Re: Array#pack: byte order for unsigned types" > on 02/04/12, "Jason Voegele" writes: > > |How, then, do "I", "L", and "S" differ from their signed counterparts? > > No difference in pack, but in unpack. > Try [-1].pack("i").unpack("i") and [-1].pack("i").unpack("i"). Okay, but then how would I unpack an unsigned integer that is in a different byte order from my underlying platform? Or do I have to do this "the long way", by pulling out the individual bytes and constructing the number myself? In other words, I need to read in data over a network connection that may or may not be in the same byte order as the architecture my code is running on (this is CORBA IIOP if you're wondering). My platform may be little endian while the data I'm reading is big endian. Thanks again! -- Jason Voegele "We believe that we invent symbols. The truth is that they invent us." -- Gene Wolfe, The Shadow of the Torturer