/// <summary> /// Calls <see cref="Finish"/> and closes the underlying /// stream when <see cref="IsStreamOwner"></see> is true. /// </summary> /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param> protected override void Dispose(bool disposing) { if (!isClosed) { isClosed = true; try { Finish(); if (CryptoTransform != null) { CryptoTransform.Dispose(); CryptoTransform = null; } } finally { if (IsStreamOwner) { BaseOutputStream.Dispose(); } } } }
public void Dispose() { CryptoTransform.Dispose(); }