Description
Describe the bug
Given a Protobuf-encoded message with more than 8,190 bytes of data, only 8,190 bytes of data are returned and the rest of the data is truncated.
To Reproduce
Steps to reproduce the behavior:
Construct a ProtoRawDecoder (or EasyProtoRawDecoder) and decode a message with a size larger than 8 KiB. No matter what the size of the initial data is, the bytes returned from the decode call will always be 8,190 bytes (8 KiB minus two varints read from the BufReader). Attempting to deserialize the message using the returned bytes will fail.
Expected behavior
All of the message bytes should be returned.
Additional context
This is due to BufReader::new
having a default capacity of 8 KiB as noted in the docs: https://doc.rust-lang.org/std/io/struct.BufReader.html#method.new