Hi all,
I'm parsing a binary file, and need to read an integer, something I
would do in C like this:

int b;
read(f, &b, sizeof(int));

obviously considering endianness. I'm pretty sure there has to be a
faster way to do it, but this is how I'm doing it right now (as you
can see, pretty naive):

class IO
  # read int, assume little endian
  def geti
    c1 = getc
    c2 = getc
    c3 = getc
    c4 = getc
    c4 << 3*8 | c3 << 2*8 | c2 << 8 | c1
  end
end

What would be the ruby-way to do it?
thanks for any tip...
-- 
rolando -- [[ knowledge is empty, fill it ]] --
"Tam pro papa quam pro rege bibunt omnes sine lege."