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

Add support for Span #57

Open
kucint opened this issue Sep 4, 2019 · 1 comment
Open

Add support for Span #57

kucint opened this issue Sep 4, 2019 · 1 comment
Assignees

Comments

@kucint
Copy link

kucint commented Sep 4, 2019

Hi, CFStream would profit very much if it would support Span. this would let to avoid unnecessary serializing of (some) objects to byte[] array.

I suggest adding following methods to CFStream:

CFStream.Append(ReadOnlySpan<byte> data);
CFStream.SetData(ReadOnlySpan<byte> data);
CFStream.Write(ReadOnlySpan<byte> data, int position);

Best!

@Numpsy
Copy link
Contributor

Numpsy commented Apr 4, 2024

@ironfede A question on TFMs in the core library (similar to #123) -

As it stands, the core library targets .NET Framework 4,0 and .NET Standard 2.0, neither of which has the Span types built in.
There is the System.Memory NuGet package which adds the types, but that only supports .NET Framework 4.5+, not 4.0.

So - I think that in order to support this, either the core library needs to target newer TFMs, or new functions would need to be conditionally compiled.

Also, I think it would be useful to add a target for .NET 6.0 or .NET Standard 2.1 such that users of those get the built in span types without having to reference the extra NuGet packages.

Any preferences in case I get time to look at this properly?

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

No branches or pull requests

3 participants