Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problems using DirectByteBuffer

Thread Tools

Problems using DirectByteBuffer

cornerback cornerback is offline
Junior Member
Join Date: Aug 2009
Posts: 2
I am passing a DirectByteBuffer from my C code to java code in parameter of java function that I am calling.

Here is what I am doing:

jobject j_data = (*env)->(*env)->NewDirectByteBuffer(env, data, len);
(*env)->CallStaticVoidMethod(env, j_class, j_method_id, j_data);
But I am getting UnsupportedOperationException on java side when I do byteBuffer.array().

I checked the address of the data that I am giving to direct byte buffer and its a valid address.

Is there anything I am missing?
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems using getaddrinfo and friends using c99 standard Nathan C Programming 4 06-18-2008 09:28 PM
Problems compiling simple C++ code (also problems with std::string) Susan Baker C++ 2 06-26-2005 01:43 AM
Re: sound problems and modem problems Harold Potter Computer Support 5 12-04-2003 04:12 PM
Problems using services which return data using xsi:nil Stan Yamane ASP .Net Web Services 1 07-15-2003 05:56 PM
DirectByteBuffer and BufferedImage for image acquisition Peter Szymanski Java 0 07-09-2003 12:29 PM