예제 #1
0
        // Token: 0x0600138D RID: 5005 RVA: 0x0007206C File Offset: 0x0007026C
        private void AddTempFileReaderToSortedList(TempFileReader tempFileReader)
        {
            bool flag;

            do
            {
                flag = true;
                TempFileReader.TempFileRecord tempFileRecord = null;
                if (!tempFileReader.NoMoreRecords)
                {
                    tempFileRecord = tempFileReader.PeekNextRecord();
                }
                if (tempFileRecord != null)
                {
                    if (!this.topRecords.ContainsKey(tempFileRecord.ObjectGuid))
                    {
                        this.topRecords.Add(tempFileRecord.ObjectGuid, tempFileReader);
                    }
                    else
                    {
                        flag = false;
                        TempFileReader.TempFileRecord tempFileRecord2 = tempFileReader.ReadNextRecord();
                        ExTraceGlobals.AssistantTracer.TraceError <string, Guid>((long)this.GetHashCode(), "TempFileReader({0}) contained a record with ObjectGuid {1} which already exists in the SortedDictionary<> topRecords.  This record is being discarded.", tempFileReader.FileName, tempFileRecord2.ObjectGuid);
                    }
                }
                else
                {
                    ExTraceGlobals.AssistantTracer.TraceDebug <string>((long)this.GetHashCode(), "TempFileReader({0}) has no more entries; disposing it", tempFileReader.FileName);
                    tempFileReader.Dispose();
                }
            }while (!flag);
        }
예제 #2
0
 // Token: 0x06001386 RID: 4998 RVA: 0x00071D60 File Offset: 0x0006FF60
 public TempFileReader.TempFileRecord ReadNextRecord()
 {
     TempFileReader.TempFileRecord result = null;
     if (this.records.Count == 0 && !this.readAllRecords)
     {
         this.ReadRecords();
     }
     if (this.records.Count > 0)
     {
         result = this.records.Dequeue();
     }
     return(result);
 }
예제 #3
0
        // Token: 0x0600138C RID: 5004 RVA: 0x00071FDC File Offset: 0x000701DC
        public byte[] GetNextRecord()
        {
            if (this.topRecords.Count == 0)
            {
                return(null);
            }
            TempFileReader value;

            using (SortedDictionary <Guid, TempFileReader> .Enumerator enumerator = this.topRecords.GetEnumerator())
            {
                enumerator.MoveNext();
                KeyValuePair <Guid, TempFileReader> keyValuePair = enumerator.Current;
                value = keyValuePair.Value;
                SortedDictionary <Guid, TempFileReader> sortedDictionary = this.topRecords;
                KeyValuePair <Guid, TempFileReader>     keyValuePair2    = enumerator.Current;
                sortedDictionary.Remove(keyValuePair2.Key);
            }
            TempFileReader.TempFileRecord tempFileRecord = value.ReadNextRecord();
            this.AddTempFileReaderToSortedList(value);
            return(tempFileRecord.Data);
        }
예제 #4
0
 // Token: 0x06001388 RID: 5000 RVA: 0x00071E34 File Offset: 0x00070034
 private void ReadRecords()
 {
     for (int i = 0; i < Globals.TempFileRecordBatchSize; i++)
     {
         if (this.binaryReader.BaseStream.Position == this.binaryReader.BaseStream.Length)
         {
             this.readAllRecords = true;
             break;
         }
         TempFileReader.TempFileRecord tempFileRecord = new TempFileReader.TempFileRecord();
         tempFileRecord.ObjectGuid = this.binaryReader.ReadGuid("AddressListRecord");
         uint num = this.binaryReader.ReadUInt32();
         tempFileRecord.Data = new byte[num];
         BitConverter.GetBytes(num).CopyTo(tempFileRecord.Data, 0);
         this.binaryReader.ReadBytes((int)(num - 4U)).CopyTo(tempFileRecord.Data, 4);
         this.records.Enqueue(tempFileRecord);
     }
     if (this.binaryReader.BaseStream.Position == this.binaryReader.BaseStream.Length)
     {
         this.readAllRecords = true;
     }
 }