Skip to content

Releases: microsoft/Microsoft.IO.RecyclableMemoryStream

Microsoft.IO.RecyclableMemoryStream 2.0.0

18 Mar 17:54
46bbc6d
Compare
Choose a tag to compare

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 throws OutOfMemoryException instead of InvalidOperationException 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 implements IBufferWriter<byte>
    • New method overloads of WriteTo that allow you write the contents of the stream directly to another byte[] buffer.
    • Reformatted all code documentation to be more readable.
  • Development-only Changes

    • Significantly improved unit test speed

Nuget: Microsoft.IO.RecyclableMemoryStream 2.0.0

Microsoft.IO.RecyclableMemoryStream 1.4.1

11 Mar 00:00
74777e5
Compare
Choose a tag to compare
  • 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.

NuGet: Microsoft.IO.RecyclableMemoryStream 1.4.1

Microsoft.IO.RecyclableMemoryStream 1.4.0

13 Jan 20:20
31a3c17
Compare
Choose a tag to compare

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 overriding GetBuffer, so you could hit UnauthorizedAccessException.
  • A bug fix for CopyToAsync. It was copying the entire stream, but the expected behavior based on System.IO.MemoryStream is to copy from the current position.
  • Some performance improvements to CopyToAsync (Thank you @paulomorgado)

NuGet: Microsoft.IO.RecyclableMemoryStream 1.4.0

Microsoft.IO.RecyclableMemoryStream 1.3.6

24 Nov 23:04
ab1745b
Compare
Choose a tag to compare

Minor updates:

  • Override CopyToAsync to save some allocations.
  • Apply AllowPartiallyTrustedCallers attribute to assembly (Thank you @LIFEfreedom)

NuGet: Microsoft.IO.RecyclableMemoryStream 1.3.6

Microsoft.IO.RecyclableMemoryStream 1.3.5

24 Jul 22:02
5e6030d
Compare
Choose a tag to compare

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.

Nuget: Microsoft.IO.RecyclableMemoryStream

Microsoft.IO.RecyclableMemoryStream 1.3.4

15 May 17:36
84918ac
Compare
Choose a tag to compare

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 call GetBuffer.

Nuget: Microsoft.IO.RecyclableMemoryStream

Microsoft.IO.RecyclableMemoryStream 1.3.3

19 Mar 17:30
400a39c
Compare
Choose a tag to compare

New APIs:

  • Added RecyclableMemoryStreamManager.ThrowExceptionOnToArray. Causes a NotSupportedException to be thrown if RecyclableMemoryStream.ToArray is called. Default is false.
  • Added overloads of RecyclableMemoryStreamManager.GetStream that accept Memory<byte> arguments.

NuGet: Microsoft.IO.RecyclableMemoryStream

Microsoft.IO.RecyclableMemoryStream 1.3.2

05 Dec 16:45
78356b1
Compare
Choose a tag to compare

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.

NuGet: Microsoft.IO.RecyclableMemoryStream

Microsoft.IO.RecyclableMemoryStream 1.3.0

18 Oct 16:01
9c3c38c
Compare
Choose a tag to compare

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

12 Apr 00:44
Compare
Choose a tag to compare

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.