You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to propose changing the contract of ISerializer to useReadOnlySpan<T> instead of byte[].
Since System.Memory is not out yet (RTM's expected with .NET Core 2.1), obviously none of the current implementations (JSON, Xml, ProtoBuf) will actually take advantage of that. It would be great though to already use ReadOnlySpan<T> on the contract to avoid any breaking changes related to this.
When support comes from underlying libraries, we'd only change the implementations to avoid the span.ToArray() calls.
It seems to me that it doesn't make sense to expose ReadOnlySpan<T> and also byte[] so I suggest we go ahead and change the current ISerializer.
I'd like to propose changing the contract of
ISerializer
to useReadOnlySpan<T>
instead ofbyte[]
.Since
System.Memory
is not out yet (RTM's expected with .NET Core 2.1), obviously none of the current implementations (JSON, Xml, ProtoBuf) will actually take advantage of that. It would be great though to already useReadOnlySpan<T>
on the contract to avoid any breaking changes related to this.When support comes from underlying libraries, we'd only change the implementations to avoid the
span.ToArray()
calls.It seems to me that it doesn't make sense to expose
ReadOnlySpan<T>
and alsobyte[]
so I suggest we go ahead and change the currentISerializer
.I've changed the contract to get an idea of the change: https://github.com/Greentube/serialization/tree/system.memory
Some tests break though, with:
I haven't investigated or filed a bug yet.
The text was updated successfully, but these errors were encountered: