Releases: microsoft/Microsoft.IO.RecyclableMemoryStream
Releases · microsoft/Microsoft.IO.RecyclableMemoryStream
Microsoft.IO.RecyclableMemoryStream 2.0.0
Major new release!
-
Breaking Changes
- Removed 2 GB stream limit. Extremely large streams can be created by chaining together blocks. Attempts to convert a stream into a contiguous buffer longer than the runtime's limits will result in an exception.
- Removed build targets for net40, net45, net46, and netstandard1.4. Added net462.
- Changed some ETW events to provide more information.
- Refactored .NET events to match the information payloads of the ETW events.
GetBuffer
now throwsOutOfMemoryException
instead ofInvalidOperationException
if the needed size is too large for a contiguous array.
-
Other Changes
- Removed use of
Interlocked
methods when checking whether the stream is disposed. This should improve performance. (Concurrent use of streams has never been supported.) RecyclableMemoryStream
now implementsIBufferWriter<byte>
- New method overloads of
WriteTo
that allow you write the contents of the stream directly to anotherbyte[]
buffer. - Reformatted all code documentation to be more readable.
- Removed use of
-
Development-only Changes
- Significantly improved unit test speed
Microsoft.IO.RecyclableMemoryStream 1.4.1
- Fixed a bug in
CopyToAsync
where it wasn't updating the current position, just like a Read would. This was different behavior than in the base class,MemoryStream
.
Microsoft.IO.RecyclableMemoryStream 1.4.0
Some important updates:
- Added netstandard2.0 target. There was an issue calling
GetBuffer
from a netstandard2.0 project, which would resolve to the netstandard1.4 target of RMS. netstandard1.4 doesn't support overridingGetBuffer
, so you could hitUnauthorizedAccessException
. - A bug fix for
CopyToAsync
. It was copying the entire stream, but the expected behavior based onSystem.IO.MemoryStream
is to copy from the current position. - Some performance improvements to
CopyToAsync
(Thank you @paulomorgado)
Microsoft.IO.RecyclableMemoryStream 1.3.6
Minor updates:
- Override
CopyToAsync
to save some allocations. - Apply
AllowPartiallyTrustedCallers
attribute to assembly (Thank you @LIFEfreedom)
Microsoft.IO.RecyclableMemoryStream 1.3.5
These changes are thanks to @ninedan
Performance Improvements
WriteByte
has been significantly optimized to be faster.CheckDisposed
, which is called in many code paths, has similarly been optimized.
Microsoft.IO.RecyclableMemoryStream 1.3.4
New API:
void WriteTo(Stream stream, int offset, int count)
-- Allows you to write a portion of the current stream to a destination stream without first having to callGetBuffer
.
Microsoft.IO.RecyclableMemoryStream 1.3.3
New APIs:
- Added
RecyclableMemoryStreamManager.ThrowExceptionOnToArray
. Causes aNotSupportedException
to be thrown ifRecyclableMemoryStream.ToArray
is called. Default isfalse
. - Added overloads of
RecyclableMemoryStreamManager.GetStream
that acceptMemory<byte>
arguments.
Microsoft.IO.RecyclableMemoryStream 1.3.2
Due to a build pipeline issue, the previous release unfortunately had Debug binaries instead of Release. That has been remedied in 1.3.2. No code changes.
Microsoft.IO.RecyclableMemoryStream 1.3.0
A long-awaited update, this release adds a number of new features, fixes bugs, and is more interoperable with .NET Core.
NuGet: Microsoft.IO.RecyclableMemoryStream
Bug Fixes
- Removed a buggy and unnecessary boundary check in Write methods.
Performance
- Removed LINQ iteration in some properties.
- Overloads of Read, SafeRead, and Write that accept Span arguments (.NET Core and .NET Standard targets only)
Functionality
- New buffer allocation strategy: exponential. Instead of linearly increasing large buffer sizes by a fixed multiple (say, 1MB), you can choose to have it increase exponentially in size, starting with smaller large buffers. This will allow you more efficient use of space, especially in smaller heap scenarios where you don't have gobs of memory to keep in a pool. We use this in Bing in some data centers that are more resource constrained than others.
- New targets for .NET Framework 4.6, .NET Standard 2.1
- Overload for TryGetBuffer, introduced in .NET Framework 4.6.
- Allow the Stream's GUID to be set explicitly
Meta
- Removed CBT build support files. Using dotnet.exe to build now.
- Added public key for delayed signing during build
- Consolidate and updated all NuGet package settings in the .csproj file.
- Added setting for generating a NuGet package for symbols (.snupkg)
Microsoft.IO.RecyclableMemoryStream 1.2.2
Changes:
- Multi-framework targeting adds support for .NET Standard 1.4.
- Migrate to CBT as build toolset.
- Migrate to MSBuild 15.
- Updates now require Visual Studio 2017 for interactive build support.