Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming parser API? #77

Open
knutwannheden opened this issue May 4, 2024 · 0 comments
Open

Streaming parser API? #77

knutwannheden opened this issue May 4, 2024 · 0 comments

Comments

@knutwannheden
Copy link

I would like to be able to use the CBOR parser as a tokenizer basically, so that I can parse a Stream (which gets its data from an underlying socket) into CBOR "tokens". The reason being that the document could contain some very large data structures (e.g. a very long array) and from what I can tell the current API would require reading the full array into memory into a corresponding CBORObject. In my case I would then copy the data from there into the application's own data structures and would thus temporarily lead to a lot of additional data being allocated (and also put more pressure on the GC).

.NET's own CBOR implementation provides a CBOR parser that can be used directly. Unfortunately it doesn't allow me to read data synchronously from a Stream, which is why I prefer to use this library. Now I am wondering how I should proceed when parsing very large arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant