Skip to content

CborReader requires a ReadOnlyMemory<byte> #73022

Answered by bartonjs
chrisspre asked this question in General
Discussion options

You must be logged in to vote

CborReader can't save a ReadOnlySpan<byte> as a field because it is not a ref struct.

When we built it, we felt that a class is much more usable, and that there probably weren't many scenarios where the caller would have a span versus an array (or Memory)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@chrisspre
Comment options

@bartonjs
Comment options

@chrisspre
Comment options

@c-ohle
Comment options

Answer selected by chrisspre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants