Closed 05nelsonm closed 1 year ago
The encodeOutSize
and decodeOutMaxSizeOrFail
methods should throw some sort of overflow exception if the number is greater than Long.MAX_VALUE
. Think a new exception here that inherits from EncodingException
would be best, in order to be specific.
EncoderDecoder.Config
methods for pre-calculating the encoded and decoded out size should accept aLong
instead ofInt
, and return aLong
decodeOutMaxSizeOrFail
should acceptnull
forinput
to be usable with streams.DecoderInput
.DecoderInput
should check for a negative return value ofdecodeOutMaxSizeOrFail
and throwEncodingException
DecoderInput
should check if the returnedLong
is greater thanInt.MAX_VALUE
and throwEncodingException
There's a possibility of the
EncoderDecoder.Config
implementation having an overflow issue, that should be checked for in the base abstraction and throw such that we can guarantee a positive value is always returned.