The following does not work properly: Java: ByteBuffer directByteBuffer = ByteBuffer.allocateDirect(10); IntBuffer directIntBuffer = directByteBuffer.asIntBuffer(); JNI: (*env)->GetDirectBufferAddress(env, directIntBuffer);
The reason for the failure is that GetDirectBufferAddress expects that the buffer is an instance of DirectByteBufferImpl, when in this case it is actually an instance of IntViewBufferImpl containing directByteBuffer. -- Summary: JNI nio buffer functions only work with byte buffers Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: juhal at users dot sourceforge dot net CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org,konqueror at gmx dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18115