Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid un-necessary byte copies when decoding a Vert.x Buffer to a pro…
…tobuf object and perform more optimal allocation. Motivation: The current implementation of the bridge uses a plain ByteArrayInputStream and then let protobuf parse the message. It turns out there is a KnownLength interface used by the parser to know the actual buffer size to be decoded and optimize the decoding process. In addition we can use Netty ByteBufInputStream to avoid using ByteArrayInputStream and un-necessary copies. Changes: Swap usage of ByteArrayInputStream with a class that extends ByteBufInputStream and implement KnownLength.
- Loading branch information