Esempio n. 1
0
 public override void Flush()
 {
     this.CheckDisposed();
     if (this.internalStream == null)
     {
         throw new NotSupportedException();
     }
     XsoStreamWrapper.MapXsoExceptions(new Action(this.internalStream.Flush));
 }
Esempio n. 2
0
 public override long Seek(long offset, SeekOrigin origin)
 {
     this.CheckDisposed();
     if (this.internalStream == null || !this.internalStream.CanSeek)
     {
         throw new NotSupportedException();
     }
     return(XsoStreamWrapper.MapXsoExceptions <long>(() => this.internalStream.Seek(offset, origin)));
 }
Esempio n. 3
0
 public override int Read(byte[] buffer, int offset, int count)
 {
     this.CheckDisposed();
     if (this.internalStream == null || !this.internalStream.CanRead)
     {
         throw new NotSupportedException();
     }
     return(XsoStreamWrapper.MapXsoExceptions <int>(() => this.internalStream.Read(buffer, offset, count)));
 }
Esempio n. 4
0
 public override void SetLength(long value)
 {
     this.CheckDisposed();
     if (this.internalStream == null || !this.internalStream.CanWrite || this.internalStream.CanSeek)
     {
         throw new NotSupportedException();
     }
     XsoStreamWrapper.MapXsoExceptions(delegate()
     {
         this.internalStream.SetLength(value);
     });
 }
Esempio n. 5
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     this.CheckDisposed();
     if (this.internalStream == null || !this.internalStream.CanWrite)
     {
         throw new NotSupportedException();
     }
     XsoStreamWrapper.MapXsoExceptions(delegate()
     {
         this.internalStream.Write(buffer, offset, count);
     });
 }
Esempio n. 6
0
 public override void Close()
 {
     try
     {
         if (!this.isClosed && this.canDisposeInternalStream && this.internalStream != null)
         {
             XsoStreamWrapper.MapXsoExceptions(new Action(this.internalStream.Close));
             this.internalStream = null;
         }
         this.isClosed = true;
     }
     finally
     {
         base.Close();
     }
 }