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

Decoding a bytes at a particular offset #211

Open
saroupille opened this issue Sep 7, 2023 · 1 comment
Open

Decoding a bytes at a particular offset #211

saroupille opened this issue Sep 7, 2023 · 1 comment

Comments

@saroupille
Copy link

Assume that I have a buffer of type Bytes.t for which the data I would like to decode are at some offset o. Is there a way to decode the bytes without doing an extra allocation (via Bytes.sub for example)?

The interface seems to get a decoder only from an entire buffer of type Bytes.t or String.t. Did I miss something?

I have the impression that a similar remark could also be made when encoding values.

Looking at the code source quickly, I have the feeling it would be quite easy to implement since the internal representation of a buffer already has this notion of offset.

@c-cube
Copy link
Collaborator

c-cube commented Sep 7, 2023 via email

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

2 participants