private void CloseCurrentStream() { if (mCurrentStream != null) { mCurrentStream.Dispose(); mCurrentStream = null; } }
/// <summary> /// Opens the current stream. Can only be called once per stream. /// Disposing the returned stream is allowed but not required. /// </summary> public Stream OpenStream() { if (this.CurrentStreamIndex == this.StreamCount) { throw new InvalidOperationException("The reader contains no more streams."); } if (mCurrentStream != null) { throw new InvalidOperationException("Each stream can only be opened once."); } mCurrentStream = new DecodedStream(mDecodedStream, this.CurrentStreamLength); return(mCurrentStream); }
/// <summary> /// Opens the current stream. Can only be called once per stream. /// Disposing the returned stream is allowed but not required. /// </summary> public Stream OpenStream() { if (this.CurrentStreamIndex == this.StreamCount) throw new InvalidOperationException("The reader contains no more streams."); if (mCurrentStream != null) throw new InvalidOperationException("Each stream can only be opened once."); mCurrentStream = new DecodedStream(mDecodedStream, this.CurrentStreamLength); return mCurrentStream; }