P
P
Pavel K2016-03-19 16:18:43
Java
Pavel K, 2016-03-19 16:18:43

How to convert QByteArray to jbyteArray and pass it to a function?

Greetings.
Java has a function, for example:

public int send(byte[] data) 
{
....
}

I need to call it from C++ and pass a QByteArray
stuck on something I can't convert:
QByteArray data;
    .... 
    jbyteArray buffer = data ; //???
    myActivity.callMethod<int>("send", "([BI)I", buffer);

Tell me, please, how is it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2016-03-19
@Zifix

How about QByteArray::data()?
The signature "([BI)I" shows that an int is also passed to the method, although I don't see it above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question