public override void Flush() { this.CheckDisposed(); if (this.internalStream == null) { throw new NotSupportedException(); } XsoStreamWrapper.MapXsoExceptions(new Action(this.internalStream.Flush)); }
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))); }
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))); }
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); }); }
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); }); }
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(); } }