コード例 #1
0
 public LngFile(Stream fileStream)
 {
     using (LngBinaryReader b = new LngBinaryReader(EndianBitConverter.Big, fileStream))
     {
         byte[] keys, values;
         hasChanges = false;
         magic      = b.ReadInt32();
         // SIZE - Skip
         b.ReadInt32();
         // Hash Section (HSHS)
         hshs = new Hshs(b);
         // Hash Table (HSHT)
         hsht = new Hsht(b);
         // Offsets (SIDA)
         sida = new SidA(b);
         // Keys (SIDB)
         sidb = new SidB(b);
         keys = b.ReadBytes(sidb.Size);
         // Values (LNGB)
         lngb   = new LngB(b);
         values = b.ReadBytes(lngb.Size);
         count  = sida.Entry.Length;
         for (int i = 0; i < sida.Entry.Length; i++)
         {
             HashEntry hEntry = new HashEntry();
             hEntry.Key   = ReadTerminatedString(keys, sida.Entry[i].KeyOffset, 0x00);
             hEntry.Value = ReadTerminatedString(values, sida.Entry[i].ValueOffset, 0x00);
             hsht.Table[GetHash(hEntry.Key)].Add(hEntry);
         }
     }
 }
コード例 #2
0
 public LngFile(Stream fileStream)
 {
     using (LngBinaryReader b = new LngBinaryReader(EndianBitConverter.Big, fileStream))
     {
         byte[] keys, values;
         hasChanges = false;
         magic = b.ReadInt32();
         // SIZE - Skip
         b.ReadInt32();
         // Hash Section (HSHS)
         hshs = new Hshs(b);
         // Hash Table (HSHT)
         hsht = new Hsht(b);
         // Offsets (SIDA)
         sida = new SidA(b);
         // Keys (SIDB)
         sidb = new SidB(b);
         keys = b.ReadBytes(sidb.Size);
         // Values (LNGB)
         lngb = new LngB(b);
         values = b.ReadBytes(lngb.Size);
         count = sida.Entry.Length;
         for (int i = 0; i < sida.Entry.Length; i++)
         {
             HashEntry hEntry = new HashEntry();
             hEntry.Key = ReadTerminatedString(keys, sida.Entry[i].KeyOffset, 0x00);
             hEntry.Value = ReadTerminatedString(values, sida.Entry[i].ValueOffset, 0x00);
             hsht.Table[GetHash(hEntry.Key)].Add(hEntry);
         }
     }
 }