Beispiel #1
0
        /// <summary>
        /// 载入所有StringId数据。
        /// string_ids_off指向字符串索引信息表起始地址,每个索引项4个字节;
        /// 索引项中存储字符串的起始地址,直接读取
        /// </summary>
        private void LoadStringIds()
        {
            long off   = GetField_Long("string_ids_off");   // string_ids信息的起始地址
            long count = GetField_Long("string_ids_size");  // string_id 数目

            for (int i = 0; i < count; i++)
            {
                byte[] data        = GetBytes(off + i * 4, 4); // 获取对应string的偏移地址
                long   StringIndex = Byter.To_Long(data);

                string str = GetString(StringIndex + 1);    // 从string对应的偏移地址开始读取字符串
                stringList.Add(str);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 获取Field表示的数值
 /// </summary>
 /// <param name="fieldName"></param>
 /// <returns></returns>
 public long GetField_Long(string fieldName)
 {
     byte[] data = GetFieldBytes(fieldName);
     return(Byter.To_Long(data));
 }