Proper way to get a mutable struct for Memory<byte> / Span<byte>?

こ雲淡風輕ζ 提交于 2019-11-30 22:19:38

Oof. It looks like MemoryMarshal.Cast is what used to be the NonPortableCast extension method (from: this commit), in which case - yes, that's the appropriate way to thunk between layouts of spans, most commonly (but not exclusively) like in this case - between byte and some struct.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!