Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
In the spec, the encoding for the bytes type is bytes are encoded as a long followed by that many bytes of data.. In the Java binary decoders they are read as ints this is not a correctness issue because the VLE of the long is the same as that of an equivalently valued int. The int is used (I assume) to enable easier interop with the ByteBuffer java class. But in the rare cases where validly encoded data of more than MAX_ARRAY_SIZE bytes is found, this change will cause an error of
throw new UnsupportedOperationException( "Cannot read arrays longer than " + MAX_ARRAY_SIZE + " bytes in Java library");
instead of
throw new InvalidNumberEncodingException("Invalid int encoding");
This type of checking is consistent with what happens in readString which reads its size as a long.
Attachments
Issue Links
- links to