zeromq / netmq

A 100% native C# implementation of ZeroMQ for .NET
Other
2.95k stars 744 forks source link

Msg does not expose Memory<byte> of the data. #978

Open Svisstack opened 3 years ago

Svisstack commented 3 years ago

Environment

NetMQ Version:    4.0.16

Expected behaviour

Msg will expose Span<byte> Slice() and Memory<byte> SliceAsMemory();

Actual behaviour

Msg.Data is marked as Obsoleteand only Span<byte> Slice() is exposed.

Steps to reproduce the behaviour

  1. Have need to have ReadOnlyMemory<byte> representing Msg.Data.
  2. Want to have a code that will not need a change on the next major release by being dependent on Obsolete.

I was wondering if this is on purpose or that function could be merged into this codebase.

drewnoakes commented 3 years ago

I was wondering if this is on purpose or that function could be merged into this codebase.

I'm not aware of any reason not to do this. Would you like to make a pull request?