Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Поиск информации о стране по ID в памяти
- private Dictionary<string, object> GetCountryMem(byte CountryID)
- {
- uint Readed = 0;
- uint NextRead = Header.CountrySize;
- SxGeoUnpack Unpacker = new SxGeoUnpack(Header.pack_country, Header.DBEncoding);
- while (Readed < Header.CountrySize - 1)
- {
- //читаем запись
- byte[] buf = bSubstr(cities_db, Readed, NextRead);
- //распаковываем запись
- int RealLength = 0;
- Dictionary<string, object> Record = Unpacker.Unpack(buf,
- out RealLength);
- //проверяем, не нашли ли запись
- if ((byte)Record["id"] == CountryID)
- {
- return Record;
- }
- //Сохраняем количество фактических байт записи
- Readed += (uint)RealLength;
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement