Problems using DirectByteBuffer

Discussion in 'Java' started by cornerback, Aug 28, 2009.

  1. cornerback

    cornerback

    Joined:
    Aug 28, 2009
    Messages:
    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:

    Code:
    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?
    cornerback, Aug 28, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Szymanski
    Replies:
    0
    Views:
    858
    Peter Szymanski
    Jul 9, 2003
  2. Susan Baker
    Replies:
    2
    Views:
    806
    kelvSYC
    Jun 26, 2005
  3. Shelly

    Problems, problems for newbie

    Shelly, Sep 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,179
    Shelly
    Sep 3, 2007
  4. Nathan
    Replies:
    4
    Views:
    426
    Nathan
    Jun 18, 2008
  5. Stan Yamane

    Problems using services which return data using xsi:nil

    Stan Yamane, Jul 14, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    134
    Stan Yamane
    Jul 15, 2003
Loading...

Share This Page