System.Formats.Cbor support object sequences #61686
Unanswered
AlgorithmsAreCool
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Howdy!
I have been looking at the new
System.Formats.Cbor
for use as an intermediate storage format. My use case requires storing several million CBOR objects in a large file which will then be decoded later.However, I have noticed that the
CborReader
class only allows constructor based on a singleReadOnlyMemory<byte>
which implies that I need to buffer the entire file upfront.I have looked into using CBOR Sequences as an encoding format, but that requires knowing the length of each entry to read/trim the buffer.
I have also considered encoding the values as an indefinite length array with each array element prefixed with it's own length. But that would require me to manually decode the array and then the length of each item without the benefit of
CborReader
.I see in the design document that reading from a stream was a non-goal, but is there anyway to chain readers together or something similar that would allow me to support larger than memory reads?
Beta Was this translation helpful? Give feedback.
All reactions