Login  Register

Re: UnsupportedOperationException from Buffers.newDirectByteBuffer()

Posted by Wade Walker on Apr 01, 2014; 2:05am
URL: https://forum.jogamp.org/UnsupportedOperationException-from-Buffers-newDirectByteBuffer-tp4032085p4032088.html

This is because ByteBuffer doesn't support the array() method for direct buffers, only for buffers allocated on the heap. With heap buffers, you pass a byte array into the constructor that it just gives back to you for array(). But in a direct buffer, it stores only the memory address of a native memory area, which is not a Java array object.