[5308] in java-interest

home help back first fref pref prev next nref lref last post

Re: Returning arrays from native methods...

daemon@ATHENA.MIT.EDU (James Waldrop)
Mon Feb 5 19:47:30 1996

To: Alligator Descartes <descarte@hermetica.com>
cc: java-interest@java.sun.com
In-reply-to: Your message of "Sun, 04 Feb 1996 20:18:27 GMT."
             <199602042018.UAA24784@fruitbat.mcqueen.com> 
Date: Mon, 05 Feb 1996 15:34:56 -0800
From: James Waldrop <sulam@construct.net>


Alligator Descartes wrote:
>Hi all. I'm attempting to return an array of ints back from a
>native method, but seem to be having no luck at all with the
>endeavour.
>
>Returning Strings and single value seem fine, but arrays are
>eluding me completely.

I suggest instead passing an array of ints and then filling
them in for further use (call be reference rather than trying
to return a pointer to a data structure that you'll have trouble
building).

i.e., do:

int myArr[] = new int[3];
myNativeCall(myArr);

rather than:

int myArr[] = new int[3];
myArr = myNativeCall();

This ends up being much easier...

James

--
James Waldrop                        /          Technical Director
sulam@construct.net              /              Construct Internet Design
sulam@well.com               /                  http://www.construct.net
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post