Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Memory<byte> support #84

Closed
cocowalla opened this issue Feb 28, 2020 · 1 comment · Fixed by #86
Closed

Additional Memory<byte> support #84

cocowalla opened this issue Feb 28, 2020 · 1 comment · Fixed by #86
Assignees

Comments

@cocowalla
Copy link

#68 added some support for RecyclableMemoryStream to read and write Span<byte>/Memory<byte>. It would be good to also add support for creating a RecyclableMemoryStream from an existing Memory<byte>.

RecyclableMemoryStream.GetStream already has an overload that takes an existing byte[] buffer:

MemoryStream GetStream(string tag, byte[] buffer, int offset, int count)

So the suggestion here is to add a new overload that takes an existing Memory<byte> buffer:

MemoryStream GetStream(string tag, Memory<byte> buffer)
@benmwatson
Copy link
Member

Sounds reasonable. I will try to get to it soon-ish. I'm doing a huge .NET Core migration this week and next, but after that I can relax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants