You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's imagine that I have a system that accepts only numbers encoded in UINT16.
Using the API with automatic header selection, it is impossible to encode values from 0 to 2^8-1 in UINT16 because MessagePacker will offer the types UINT8, INT8, NEGFIXINT, POSFIXINT. This will happen until the number exceeds the ranges UINT8, INT8, NEGFIXINT, POSFIXINT.
Suggestions for API improvements for statically typed systems
I suggest introducing an API in which the client can choose the type of encoded header.
For example:
Here, a method should be understood as a set of overloaded methods with short, int, long, BigInteger value arguments . Conversion based on narrowing casting
A similar solution for FLOAT32/64 types, INT8,16,32,64 families.
The code has already been written, it remains to send a PR
The text was updated successfully, but these errors were encountered:
Problem description
Let's imagine that I have a system that accepts only numbers encoded in
UINT16
.Using the API with automatic header selection, it is impossible to encode values from
0
to2^8-1
inUINT16
becauseMessagePacker
will offer the typesUINT8
,INT8
,NEGFIXINT
,POSFIXINT
. This will happen until the number exceeds the rangesUINT8
,INT8
,NEGFIXINT
,POSFIXINT
.Suggestions for API improvements for statically typed systems
I suggest introducing an API in which the client can choose the type of encoded header.
For example:
Here, a method should be understood as a set of overloaded methods with
short
,int
,long
,BigInteger
value arguments . Conversion based on narrowing castingA similar solution for
FLOAT32/64
types,INT8,16,32,64
families.The code has already been written, it remains to send a PR
The text was updated successfully, but these errors were encountered: