public override void DeSerialize(DataReader data)
 {
     header.DeSerialize(data);
     uint n1 = BitConverter.ToUInt32(new byte[] { 1, 0, 0, 0 }, 0);
     data.byteOrder = DataReader.ByteOrder.Little;
     //compress with lzma
     if (!header.signature.Contains("UnityRaw")) {
         SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
         data.position = header.headerSize;
         byte[] properties = data.ReadBytes(5);
         long uncompressFileSize = data.ReadInt64();
         decoder.SetDecoderProperties(properties);
         MemoryStream outMs = new MemoryStream((int)uncompressFileSize);
         decoder.Code(data.BaseStream,outMs,data.BaseStream.Length-header.headerSize,uncompressFileSize,null);
         data.Close();
         data = new DataReader(outMs);
         data.position = 0;
     }
     data.byteOrder = DataReader.ByteOrder.Big;
     numOfEntryCount = data.ReadInt32();
     entrys = new SerializeBundleEntry[numOfEntryCount];
     for (int i = 0; i < numOfEntryCount; i++) {
         entrys[i] = new SerializeBundleEntry();
         entrys[i].DeSerialize(data);
     }
 }
 public SerializeObject(TypeTree type, byte[] rawData)
 {
     RootProperty = new SerializeProperty(type);
     MemoryStream ms = new MemoryStream(rawData);
     DataReader br = new DataReader(ms);
     RootProperty.DeSerialize(br);
     br.Close();
     ms.Close();
 }
 static public bool IsBundle(string path)
 {
     try {
         FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
         DataReader data = new DataReader(fs);
         data.byteOrder = DataReader.ByteOrder.Big;
         string signature = data.ReadStringNull();
         data.Close();
         fs.Dispose();
         if (signature.Contains("Unity")) {
             return true;
         }
         return false;
     } catch {
         return false;
     }
 }
        static public TypeTreeDataBase GenerateTypeTreeDataBase(SerializeAssetV15 asset)
        {

            TypeTreeDataBase DB = new TypeTreeDataBase();
            Dictionary<int, string> typeNameTable = new Dictionary<int, string>();
            //一个共享的类型字符串表
            string defaultTypeStr = Properties.Resources.ResourceManager.GetString("TypeStringTableV15");
            var typeStrArray = defaultTypeStr.Split('\n');
            int startOffset = 1 << 31;
            for (int i = 0; i < typeStrArray.Length; i++) {
                typeNameTable[startOffset] = typeStrArray[i].Substring(0, typeStrArray[i].Length-1);
                startOffset += typeStrArray[i].Length;
            }

            foreach (var baseClass in asset.classes) {
                if (baseClass.stringTable == null) continue;
                Dictionary<int, string> onwerStrTable = new Dictionary<int, string>();
                MemoryStream ms = new MemoryStream(baseClass.stringTable);
                DataReader data = new DataReader(ms);
                TypeTree rootType = new TypeTree();
                TypeTree nodePrev = null;
                
                Dictionary<TypeTree, int> typeLevelDic = new Dictionary<TypeTree, int>();
                foreach (var field in baseClass.types) {
                    string name = "";
                    string type = "";
                    if (field.nameOffset < 0) {
                        if (typeNameTable.ContainsKey(field.nameOffset)) {
                            name = typeNameTable[field.nameOffset];
                        }
                    } else {
                        data.position = field.nameOffset;
                        name = data.ReadStringNull();
                    }

                    if (field.typeOffset < 0) {
                        if (typeNameTable.ContainsKey(field.typeOffset)) {
                            type = typeNameTable[field.typeOffset];
                        }
                    } else {
                        data.position = field.typeOffset;
                        type = data.ReadStringNull();
                    }

                    if (nodePrev == null) {
                        rootType.name = name;
                        rootType.type = type;
                        rootType.metaFlag = field.metaFlag;
                        nodePrev = rootType;
                        typeLevelDic[nodePrev] = field.treeLevel;
                        continue;
                    }
                    TypeTree nodeCurr = new TypeTree();
                    nodeCurr.name = name;
                    nodeCurr.type = type;
                    nodeCurr.metaFlag = field.metaFlag;
                    typeLevelDic[nodeCurr] = field.treeLevel;
                    int levels = typeLevelDic[nodePrev] - field.treeLevel;
                    if (levels >= 0) {
                        for (int i = 0; i < levels; i++) {
                            nodePrev = nodePrev.parent;
                        }
                        nodePrev.parent.AddChild(nodeCurr);
                    } else {
                        nodePrev.AddChild(nodeCurr);
                    }
                    nodePrev = nodeCurr;
                }
                DB.Put(15, baseClass.ClassID, rootType);
                Console.Write(rootType);
                data.Close();
                ms.Close();
            }
            return DB;
        }