You can decode your jbyteArray and create a java object from it, but there
are no methods mystically attach to it,
just by saving a stream of data... So.. you should be able to cast it to an
array of bytes in java, and access methods of a java array, but that is
about it there is not much else possible.
What you want is to have a C++ wrapper that can be created from a JByteArray
and something else, and a Java class that can be created from an array of
bytes, and from something else... What you are doing by creating a
jbytearray, is something like streaming an object. But you would need to
create your own streaming operators/functions in both java an C++, so they
would know what byte[X] of the byte stream is.
Jesper
"Tim Wong" <ti************@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have a java method setup where it will be accessed in C++ via JNI.
The process is as follows:
1) C++ function getObject(...) is called.
2) getObject(...) uses JNI to access a java class method
getJObject(...).
3) getJObject(...) will do some calculations, save them to a complex
object. This object is downcasted to the class "Object" and returned.
4) C++ function getObject(...) get's back a <jbyteArray> from the JNI
call and casts this to a jobject.
My question is...what can methods can I perfrom on this jobject. What
fields can I access? I'm trying to convert it into an already existing
C++ class, but am unsure on what i can do.
Help Please!
Tim