Microsoft.IO.RecyclableMemoryStream 3.0.0
Breaking Changes
- Removed
int
-based constructor andGetStream
overloads wherelong
-based methods exist. - Removed all methods marked with
[Obsolete]
:StreamDisposedEventArgs.ctor(Guid, string, string, string)
RecyclableMemoryStreamManager.GetStream(Guid, string, Memory<byte>)
RecyclableMemoryStreamManager.GetStream(Memory<byte>)
RecyclableMemoryStreamManager.GetStream(string, Memory<byte>)
- Enable nullable annotations and warnings. i.e., added
<Nullable>enabled</Nullable>
to the project file. - All overloads of
RecyclableMemoryStreamManager.GetStream
now return typeRecyclableMemoryStream
instead ofMemoryStream
. - Removed explicit targets for net462, netcoreapp2.1, and net5.0. Supported targets are netstandard2.0, netstandard2.1, and net6.0 (there are a few net6.0-specific optimizations).
- Moved all the configuration settings for
RecyclableMemoryStreamManager
to the newRecyclableMemoryStreamManager.Options
class. Removed many of the constructors as a result. This class will facilitate easier dependency injection through use of the Options pattern, for those who need it. - Renamed some settings' names to be more consistent (e.g.,
MaximumLargePoolFreeBytes
)
New Features
- Added a new option for
RecyclableMemoryStreamManager
:ZeroOutBuffer
, which will cause all buffers to be cleared on allocation and when returning to the pool. Off by default.
Other Changes
- Upgrade NUnit test library to version 4.
- Fix some spelling issues in comments and variable names.
- Update code to the latest recommended C# syntax.