Beispiel #1
0
        public override void Read(EndiannessAwareBinaryReader reader, bool readName)
        {
            base.Read(reader, readName);

            TagType nextType;

            while ((nextType = (TagType)reader.ReadByte()) != TagType.TAG_End)
            {
                Tag nextTag = null;
                switch (nextType)
                {
                case TagType.TAG_Byte:
                    nextTag = new TagByte(reader, true);
                    break;

                case TagType.TAG_Short:
                    nextTag = new TagShort(reader, true);
                    break;

                case TagType.TAG_Int:
                    nextTag = new TagInt(reader, true);
                    break;

                case TagType.TAG_Long:
                    nextTag = new TagLong(reader, true);
                    break;

                case TagType.TAG_Float:
                    nextTag = new TagFloat(reader, true);
                    break;

                case TagType.TAG_Double:
                    nextTag = new TagDouble(reader, true);
                    break;

                case TagType.TAG_Byte_Array:
                    nextTag = new TagByteArray(reader, true);
                    break;

                case TagType.TAG_String:
                    nextTag = new TagString(reader, true);
                    break;

                case TagType.TAG_List:
                    nextTag = new TagList(reader, true);
                    break;

                case TagType.TAG_Compound:
                    nextTag = new TagCompound(reader, true);
                    break;

                case TagType.TAG_Int_Array:
                    nextTag = new TagIntArray(reader, true);
                    break;

                case TagType.TAG_Long_Array:
                    nextTag = new TagLongArray(reader, true);
                    break;
                }

                this.entries.Add(nextTag.Name, nextTag);
            }
        }