Ejemplo n.º 1
0
        public override void Write(long position, byte[] buffer, int offset, int count)
        {
            if (isReadOnly)
            {
                throw new InvalidOperationException("Write to read-only DataStorage");
            }

            if (count != 0)
            {
                if (fileStream == null)
                {
                    fileStream   = TempFileStream.CreateInstance();
                    filePosition = 0;
                }

                fileStream.Write(buffer, offset, count);

                position += count;

                if (position > totalLength)
                {
                    totalLength = position;
                }
            }
        }
Ejemplo n.º 2
0
 // Token: 0x06000C3D RID: 3133 RVA: 0x0006C0CC File Offset: 0x0006A2CC
 public override void SetLength(long length)
 {
     base.ThrowIfDisposed();
     if (this.isReadOnly)
     {
         throw new InvalidOperationException("Write to read-only DataStorage");
     }
     this.totalLength = length;
     if (length <= (long)this.buffer.MaxBytes)
     {
         this.buffer.SetLength(length);
         if (this.fileStream != null)
         {
             this.fileStream.SetLength(0L);
             return;
         }
     }
     else
     {
         this.buffer.SetLength((long)this.buffer.MaxBytes);
         if (this.fileStream == null)
         {
             this.fileStream   = TempFileStream.CreateInstance();
             this.filePosition = 0L;
         }
         this.fileStream.SetLength(length - (long)this.buffer.MaxBytes);
     }
 }
Ejemplo n.º 3
0
 // Token: 0x06000C3C RID: 3132 RVA: 0x0006BF90 File Offset: 0x0006A190
 public override void Write(long position, byte[] buffer, int offset, int count)
 {
     base.ThrowIfDisposed();
     if (this.isReadOnly)
     {
         throw new InvalidOperationException("Write to read-only DataStorage");
     }
     if (count != 0)
     {
         if (position < (long)this.buffer.MaxBytes)
         {
             int num = this.buffer.Write(position, buffer, offset, count);
             offset   += num;
             count    -= num;
             position += (long)num;
             if (position > this.totalLength)
             {
                 this.totalLength = position;
             }
         }
         else if (this.buffer.Length < this.buffer.MaxBytes)
         {
             this.buffer.SetLength((long)this.buffer.MaxBytes);
             this.totalLength = (long)this.buffer.MaxBytes;
         }
         if (count != 0)
         {
             if (this.fileStream == null)
             {
                 this.fileStream   = TempFileStream.CreateInstance();
                 this.filePosition = 0L;
             }
             if (this.filePosition != position - (long)this.buffer.MaxBytes)
             {
                 this.fileStream.Position = position - (long)this.buffer.MaxBytes;
             }
             this.fileStream.Write(buffer, offset, count);
             position         += (long)count;
             this.filePosition = position - (long)this.buffer.MaxBytes;
             if (position > this.totalLength)
             {
                 this.totalLength = position;
             }
         }
     }
 }
Ejemplo n.º 4
0
 // Token: 0x06000CAB RID: 3243 RVA: 0x0006EADB File Offset: 0x0006CCDB
 public static TempFileStream CreateInstance(string prefix)
 {
     return(TempFileStream.CreateInstance(prefix, true));
 }
Ejemplo n.º 5
0
 // Token: 0x06000CAA RID: 3242 RVA: 0x0006EACF File Offset: 0x0006CCCF
 public static TempFileStream CreateInstance()
 {
     return(TempFileStream.CreateInstance("Cts"));
 }