C#C
C#3y ago
2 replies
DecodedLogic

❔ RecyclableMemoryStreams and Sending a Byte Array

I am utilizing
RecyclableMemoryStream
to pool my memory streams in my networking project, but the issue comes from how Microsoft describes the use of
ToArray()
to essentially cancel out the benefits of using recyclable streams.

I need to pass a byte array across the wire (i.e. I need to pass a byte array to ENet). How do I do this in the most performant way possible and not minimize the benefits of using the RecyclableMemoryStreams library?
Was this page helpful?