From: Rolando Abarca Date: 2006-10-13T02:10:17+09:00 Subject: Re: IO.readint ? Thanks a lot, I'll try that!!! On 10/12/06, Tim Pease wrote: > class IO > def geti( endian = :little ) > str = self.read( 4 ) > str = str.reverse if endian == :little > str.unpack( 'N' )[0] > end > end > > > The default for this method is to return the integer in little endian > byte order. You can change this by passing :big as an argument ... > > io.geti :big > > It does not have to be :big, but I'm just following the metaphor of > using :little for little endian byte order. > > Blessings, > TwP -- rolando -- [[ knowledge is empty, fill it ]] -- "Tam pro papa quam pro rege bibunt omnes sine lege."