google / google/protobuf.dart

CodedBufferReader should have a getter for _bufferPos

Open
#562 3 comments 1 reaction 0 assignees View on GitHub
feature request
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.