CodedBufferReader should have a getter for _bufferPos
- Dominant language
- Dart
- Stars
- 572
- Forks
- 196
- Avg merge
- 1h 59m
- Merged PRs (30d)
- 2
Description
When reading delimited messsages from a socket, the data may come in in smaller packets.
The typical way to read the messages is by first decoding the message size from with readInt32, then it is possible to decide if the entire message is already in the buffer or if it is required to wait for additional packages before deoding the message.
However as the message size is a varint, the number of bytes used for the size descriptor may vary. There is currently no way of telling how many bytes the CodedBufferReader has consumed in the readInt32, as the _bufferPos member is private.
Adding a getter to access this property would make decoding of delimited message much easier. The coding for this is trivial.
Contributor guide
Assessment
This issue has not been assessed yet.