jklamer opened a new pull request, #2210:
URL: https://github.com/apache/avro/pull/2210

   ***NEED HELP ACCESSING JIRA ACCOUNT TO FILE ISSUE FOR THIS***
   ## What is the purpose of the change
   
   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, it 
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. 
   
   ## Verifying this change
   
   *(Please pick one of the following options)*
   
   
   This change is already covered by existing tests, such as any test that 
decodes bytes from a static 
   
   
   ## Documentation
   
   - Does this pull request introduce a new feature? no
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@avro.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to