mransan/ocaml-protoc

Decoding a bytes at a particular offset

saroupille opened this issue · 1 comments

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 commented