class CFPropertyList::Binary

def read_binary_dict(fname,fd,length)

Read a dictionary value, including contained objects
def read_binary_dict(fname,fd,length)
  dict = {}
  # first: read keys
  if(length != 0) then
    buff = fd.read(length * @object_ref_size)
    keys = buff.unpack(@object_ref_size == 1 ? "C*" : "n*")
    # second: read object refs
    buff = fd.read(length * @object_ref_size)
    objects = buff.unpack(@object_ref_size == 1 ? "C*" : "n*")
    # read real keys and objects
    0.upto(length-1) do |i|
      key = read_binary_object_at(fname,fd,keys[i])
      object = read_binary_object_at(fname,fd,objects[i])
      dict[key.value] = object
    end
  end
  CFDictionary.new(dict)
end