protected function readBinaryDict($length)
    {
        $dict = new CFDictionary();

        // first: read keys
        if ($length != 0) {
            if (strlen($buff = substr($this->content, $this->pos, $length * $this->objectRefSize)) != $length * $this->objectRefSize) {
                throw IOException::readError("");
            }
            $this->pos += $length * $this->objectRefSize;
            $keys = self::unpackWithSize($this->objectRefSize, $buff);

            // second: read object refs
            if (strlen($buff = substr($this->content, $this->pos, $length * $this->objectRefSize)) != $length * $this->objectRefSize) {
                throw IOException::readError("");
            }
            $this->pos += $length * $this->objectRefSize;
            $objects = self::unpackWithSize($this->objectRefSize, $buff);

            // read real keys and objects
            for ($i=0; $i<$length; ++$i) {
                $key = $this->readBinaryObjectAt($keys[$i+1]+1);
                $object = $this->readBinaryObjectAt($objects[$i+1]+1);
                $dict->add($key->getValue(), $object);
            }
        }

        return $dict;
    }