As MemoryStream is an unmanaged resource does it always have to be disposed?
Given:
1) A method is invoked.
2) A MemoryStream object is created (Mem
Any type that implements IDisposable
should have Dispose
called on it either explicitly via a try/catch/finally block or via the using statement.
There are cases such as this where technically the MemoryStream
does not need disposed, however to honor the interface and protect yourself from changes downstream Dispose
should still be called.