title: Ruby - read bytes from a file, convert to integer
body: <p>I'm trying to read unsigned integers from a file (stored as consecutive byte) and convert them to Integers. I've tried this:</p>
  
  <pre><code>file = File.new(filename,"r")
  num = file.read(2).unpack("S") #read an unsigned short
  puts num #value  will be less than expected
  </code></pre>
  
  <p>What am I doing wrong here?</p>