The post records the issue I met when using protobuf uint64 and Java Long.
When we define some protobuf message with ab “uint64”(unsigned int64) type field in it, and decode the corresponding binary payload to a Java object, the uint64 field in protobuf format will be mapped to a Long type Java field.
An potential issue may happen in such case: if the uint64 number is bigger than ”Long.MAX_VALUE”, it will be converted to a negative Java Long value. For example:
1 2 3
This caused confusions and issues. To fix it, use the code below to convert:
1 2 3 4 5 6 7 8 9 10 11