Пример #1
0
        public static CacheHeaderInfo DecodeCacheHeader(byte[] cacheHeader)
        {
            int                offset       = 0;
            string             identityCode = ReadString(cacheHeader, ref offset);
            Guid               cacheId      = ReadGuid(cacheHeader, ref offset);
            CacheTypeOption    cacheType    = ReadEnum <CacheTypeOption>(cacheHeader, ref offset);
            string             subSection   = ReadString(cacheHeader, ref offset);
            int                columnCount  = ReadInt32(cacheHeader, ref offset);
            List <CacheColumn> cacheColumns = new List <CacheColumn>();

            for (int index = 0; index < columnCount; index++)
            {
                string name                  = ReadString(cacheHeader, ref offset);
                int    size                  = ReadInt32(cacheHeader, ref offset);
                int    columnIndex           = ReadInt32(cacheHeader, ref offset);
                CacheDataTypeOption dataType = ReadEnum <CacheDataTypeOption>(cacheHeader, ref offset);
                int extendPropertiesCount    = ReadInt32(cacheHeader, ref offset);
                Dictionary <string, string> extendedProperties = ReadExtendedProperties(cacheHeader, extendPropertiesCount, ref offset);

                cacheColumns.Add(new CacheColumn(columnIndex, name, dataType, size, extendedProperties));
            }

            int headerExtPropCount = ReadInt32(cacheHeader, ref offset);
            Dictionary <string, string> headerExtProperties = ReadExtendedProperties(cacheHeader, headerExtPropCount, ref offset);

            return(new CacheHeaderInfo(identityCode, subSection, cacheId, cacheType, cacheColumns.ToArray(), headerExtProperties));
        }
Пример #2
0
 public CacheColumn(int index, string name, CacheDataTypeOption dataType, int size, Dictionary <string, string> extendedProperties = null)
 {
     this.index              = index;
     this.name               = name;
     this.dataType           = dataType;
     this.size               = size;
     this.extendedProperties = extendedProperties;
 }