Beispiel #1
0
        // Token: 0x060010BE RID: 4286 RVA: 0x0007A1E4 File Offset: 0x000783E4
        public int Read(char[] buffer, int offset, int count)
        {
            int num = 0;

            while (count != 0)
            {
                int num2 = this.headEntry.Read(buffer, offset, count);
                offset            += num2;
                count             -= num2;
                num               += num2;
                this.cachedLength -= num2;
                if (this.headEntry.Length == 0)
                {
                    TextCache.CacheEntry cacheEntry = this.headEntry;
                    this.headEntry = this.headEntry.Next;
                    if (this.headEntry == null)
                    {
                        this.tailEntry = null;
                    }
                    cacheEntry.Next = this.freeList;
                    this.freeList   = cacheEntry;
                }
                if (count == 0 || this.headEntry == null)
                {
                    break;
                }
            }
            return(num);
        }
Beispiel #2
0
 // Token: 0x060010B9 RID: 4281 RVA: 0x0007A0B0 File Offset: 0x000782B0
 public void Reset()
 {
     while (this.headEntry != null)
     {
         this.headEntry.Reset();
         TextCache.CacheEntry cacheEntry = this.headEntry;
         this.headEntry = this.headEntry.Next;
         if (this.headEntry == null)
         {
             this.tailEntry = null;
         }
         cacheEntry.Next = this.freeList;
         this.freeList   = cacheEntry;
     }
     this.cachedLength = 0;
 }
Beispiel #3
0
 // Token: 0x060010BD RID: 4285 RVA: 0x0007A174 File Offset: 0x00078374
 public void ReportRead(int count)
 {
     this.headEntry.ReportRead(count);
     this.cachedLength -= count;
     if (this.headEntry.Length == 0)
     {
         TextCache.CacheEntry cacheEntry = this.headEntry;
         this.headEntry = this.headEntry.Next;
         if (this.headEntry == null)
         {
             this.tailEntry = null;
         }
         cacheEntry.Next = this.freeList;
         this.freeList   = cacheEntry;
     }
 }
Beispiel #4
0
 // Token: 0x060010BF RID: 4287 RVA: 0x0007A278 File Offset: 0x00078478
 private void AllocateTail(int size)
 {
     TextCache.CacheEntry cacheEntry = this.freeList;
     if (cacheEntry != null)
     {
         this.freeList   = cacheEntry.Next;
         cacheEntry.Next = null;
     }
     else
     {
         cacheEntry = new TextCache.CacheEntry(size);
     }
     if (this.tailEntry != null)
     {
         this.tailEntry.Next = cacheEntry;
     }
     else
     {
         this.headEntry = cacheEntry;
     }
     this.tailEntry = cacheEntry;
 }