A value is serialized to a big-endian byte arrays using {@link BigInteger} 'sconstructor and {@code toByteArray} methods. Before the array containing the{@code BigInteger} data, the serialized value contains a size value of the{@code BigInteger} data (which may be less than the fixed size of thisobject). For fixed sizes of less than 256 bytes, one unsigned byte is used to represent the size. For sizes of 256 bytes or larger, a signed integer (four bytes) is used for the size.
The configured size of this object determines how big the serialized {@code BigInteger}:s can be. For an object size of of {@code n} bytes, where {@code n} is less than or equal to 256 bytes, the maximum {@code BigInteger} valueis {@code 2^((n - 1)*8 - 1) - 1} and the minimum value is {@code -2^((n -1)*8 - 1)}. For {@code n} values larger than 256, the maximum value is{@code 2^((n - 4)*8 - 1) - 1} and the minimum value is {@code -2^((n - 4)*8 -1)}.
This serializer uses a special, configurable value to represent {@code null}{@code BigInteger}:s. @author Karl Gustafsson @since 1.0 @see FixedSizeBigIntegerSerializer @see ConfigurableLengthLongNullSerializer @see java.math.BigInteger
|
|
|
|
|
|