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
Calling array() on a ByteBuffer that hasArray=false (eg a read-only byte buffer) will lead to an exception.
In the cases where hasArray=false, a decision needs to be made over whether you can iterate over the bytes of the Buffer using other ByteBuffer methods or whether you could do something like wrap the ByteBuffer in an enclosing class - eg something like ByteBufferBackedInputStream
The text was updated successfully, but these errors were encountered:
It is recommended to call ByteBuffer.hasArray before calling ByteBuffer.array()
avro4s calls array() in quite a few places.
https://github.com/search?q=repo%3Asksamuel%2Favro4s%20array()&type=code
See javadoc:
https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html#array--
Calling array() on a ByteBuffer that hasArray=false (eg a read-only byte buffer) will lead to an exception.
In the cases where hasArray=false, a decision needs to be made over whether you can iterate over the bytes of the Buffer using other ByteBuffer methods or whether you could do something like wrap the ByteBuffer in an enclosing class - eg something like ByteBufferBackedInputStream
The text was updated successfully, but these errors were encountered: