class CFPropertyList::Binary

def read_binary_int(fname,fd,length)

read a binary int value
def read_binary_int(fname,fd,length)
  raise CFFormatError.new("Integer greater than 8 bytes: #{length}") if length > 3
  nbytes = 1 << length
  val = nil
  buff = fd.read(nbytes)
  case length
  when 0 then
    val = buff.unpack("C")
    val = val[0]
  when 1 then
    val = buff.unpack("n")
    val = val[0]
  when 2 then
    val = buff.unpack("N")
    val = val[0]
  when 3
    hiword,loword = buff.unpack("NN")
    val = hiword << 32 | loword
  end
  return CFInteger.new(val);
end