-
CborReader has only one constructor and that requires a ReadOnlyMemory Would it not be possible to pass in a ReadOnlySpan and therefore saving a potential allocation for the client of the reader? |
Beta Was this translation helpful? Give feedback.
Answered by
bartonjs
Jul 28, 2022
Replies: 1 comment 4 replies
-
CborReader can't save a 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) |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
chrisspre
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CborReader can't save a
ReadOnlySpan<byte>
as a field because it is not aref 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)