I want to pass the memory location of a byte array to a jni call so that the array does not have to be copied. There is a question here that hints this is possible with sun.misc.Unsafe. Is there an example of how this can be done?
The use case is that I have a BufferedImage and I have a OpenGL method that takes in a pointer. I know that the obvious thing to do is to allocate a direct bytebuffer but I want to save on the copy.