amazon-ion / ion-java

Java streaming parser/serializer for Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
865 stars 110 forks source link

Change readVarUInt to a long #170

Open raganhan opened 6 years ago

raganhan commented 6 years ago

Follow up for https://github.com/amzn/ion-java/issues/146

Change readVarUInt to use long instead of int. This will allow support for bigger VarUInt values allowing for bigger values and containers to be supported

From #62: There are upper bound limitations in the IonReader on specific IonTypes.

These limitations exists due to values that exceed the representable range of the 32-bit Java int primitive.

VarUInt basic field format has a upper bound of 0x7FFFFFFF. This affects SIDs, i.e. the max SID that can be read without throwing an exception is $2147483647.

VarInt basic field format has a upper bound of 0x7FFFFFFF. This affects IonDecimal's exponent values, i.e. the max exponent of an IonDecimal that can be read without throwing an exception is 2147483647.

Imported from ION-306,IONJAVA-78

raganhan commented 5 years ago

This issue also affects SIDs, i.e. the max SID that can be read without throwing an exception is $2147483647.

The same problem exists for VarInt, it has an upper bound of 0x7FFFFFFF. This affects IonDecimal's exponent values, i.e. the max exponent of an IonDecimal that can be read without throwing an exception is 2147483647.