Multi-dimensional arrays are not automatically mapped by JNA. The
primary reason is that Java multi-dimensional arrays are not
contiguous in memory, while most native multi-dimensional arrays are.
Auto-converting would require non-trivial memory management and
copying of data to fit into the native space, and require several
alternatives depending on the actual native layout desired. If you
think this is a worthwhile feature, feel free to submit an RFE at
https://jna.dev.java.net/servlets/ProjectIssues
, with use cases.
See additional comments below:
On May 20, 2008, at 11:19 AM, ilya...@mail.ru wrote:
Hi!
I've create simple application for test calling of dll functions and
receive NullPointerException:
public static class ArrayClass {
public byte[][] list = new byte[16][256];
}
public static class TextList extends Structure {
public int count;
public byte list[][] = new byte[16][128];
}
struct TTextList{
int Count;
char List[16][128];
};
There is no automatic mapping from Java multi-dimensional arrays to
native multi-dimensional arrays. You can provide an implementation of
NativeMapped to do so, or simply store the data in a single Java array
of sufficient size.
BTW, you need to be subscribed to the users list in order to post.