JNI and multidimensional arrays

Hi

the last days i spent searching information on how to process larger multidimensional primitive arrays ([5][300][300]) with JNI but i failed to find stringent proof for it is possible or not. Maybe somebody her can help:

i want to pass a 3D array of ints to a c-function and do excessive manipulation there, then pass the array back. Possible? where can i find sources on that?

Thanks for any help

Shin

[436 byte] By [shinzilorda] at [2007-9-28 5:21:17]
# 1

Yes.. this is quite possible. To take your example, you would access foo[1][2][3] like this:jojbectArray middleArray = static_cast<jobjectArray>( env->GetObectArrayElement( fooArray, 1 ) );

jintArray endArray = static_cast<jobjectArray>( env->GetObjectArrayElement( middleArray, 2 ) );

int element = env->GetIntArrayElement( endArray, 3 );

God bless,

-Toby Reyelts

Check out the free, open-source JNI toolkit, Jace - http://jace.reyelts.com/jace

rreyeltsa at 2007-7-9 16:32:11 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Thanks, i check this out eventhough it sounds mandarin to me. or is it c++?Shin
shinzilorda at 2007-7-9 16:32:11 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
Mandarin?God bless,-Toby ReyeltsCheck out the free, open-source JNI toolkit, Jace - http://jace.reyelts.com/jace
rreyeltsa at 2007-7-9 16:32:11 > top of Java-index,Java HotSpot Virtual Machine,Specifications...