System.Net.Http.StreamToStreamCopy.DisposeSource C# (CSharp) Method

DisposeSource() private static method

Disposes the source stream if disposeSource is true.
private static DisposeSource ( Stream source ) : void
source System.IO.Stream
return void
        private static void DisposeSource(Stream source)
        {
            try
            {
                source.Dispose();
            }
            catch (Exception e)
            {
                // Dispose() should never throw, but since we're on an async codepath, make sure to catch the exception.
                if (NetEventSource.IsEnabled) NetEventSource.Error(null, e);
            }
        }
    }