public void Dispose() { var stream = this.DataStream; this.DataStream = null; if (stream != null && stream.CanRead) { stream.Dispose(); } }