Esempio n. 1
0
            public XeusOptions Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                string p_configDirectoryPath = string.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_configDirectoryPath = r.GetString(1024);
                        break;
                    }
                    }
                }

                return(new XeusOptions(p_configDirectoryPath));
            }
Esempio n. 2
0
            public SharedBlocksMetadata Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                string p_path        = string.Empty;
                ulong  p_length      = 0;
                uint   p_blockLength = 0;

                OmniHash[] p_hashes = global::System.Array.Empty <OmniHash>();

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_path = r.GetString(1024);
                        break;
                    }

                    case 1:
                    {
                        p_length = r.GetUInt64();
                        break;
                    }

                    case 2:
                    {
                        p_blockLength = r.GetUInt32();
                        break;
                    }

                    case 3:
                    {
                        var length = r.GetUInt32();
                        p_hashes = new OmniHash[length];
                        for (int i = 0; i < p_hashes.Length; i++)
                        {
                            p_hashes[i] = OmniHash.Formatter.Deserialize(r, rank + 1);
                        }
                        break;
                    }
                    }
                }

                return(new SharedBlocksMetadata(p_path, p_length, p_blockLength, p_hashes));
            }