/// <summary> /// Read the specified buffer, offset and count. /// </summary> /// <param name='buffer'> /// Buffer. /// </param> /// <param name='offset'> /// Offset. /// </param> /// <param name='count'> /// Count. /// </param> public override int Read(byte[] buffer, int offset, int count) { lock(this.l) { if (this.aborted) { this.Exception = new AbortException(); throw this.exception; } } return this.Stream.Read(buffer, offset, count); }
/// <summary> /// Write the specified buffer, offset and count. /// </summary> /// <param name='buffer'> /// Buffer. /// </param> /// <param name='offset'> /// Offset. /// </param> /// <param name='count'> /// Count. /// </param> public override void Write(byte[] buffer, int offset, int count) { lock(this.l) { if (this.aborted) { this.Exception = new AbortException(); throw this.exception; } } this.Stream.Write(buffer, offset, count); }