Microsoft.IO.RecyclableMemoryStream 2.2.0
API changes:
- Add an override for
GetStream
that takes aReadOnlySpan<byte>
. This supercedes the versions ofGetStream
that takeMemory<byte>
, which were marked as[Obsolete]
.
Bug Fixes:
- Fixed:
GetReadOnlySequence()
throwsArgumentOutOfRangeException
Performance Improvements:
- Removed enumerator allocation when returning blocks to the pool.
- Changed default size of stream's block list to 0 because
EnsureCapacity
will always run, potentially resizing the list anyway. - Removed unneeded closure allocation when copying buffers.
- Use
GC.AllocateUninitializedArray
in an additional spot, for better performance in .NET 5+.
Documentation:
- Improved documentation, standardized puncutation, fixed code formatting.