Monday, March 25, 2002 07:53 AM
If you check the Documentation on the ByteBuffer (http://java.sun.com/j2se/1.4/docs/api/index.html) you will see that next to the array()
function description there is an "optional operation" comment. The JNI implementation of the ByteBuffer does not implement this optional operation, so you have to do a copy. Call hasArray()
to find out if the optional array()
function is implemented.
Also, if you are using the same buffer over and over, don't forget to rewind() before get() operations, or exceptions will be generated.