Well, I have a little spare time, now, so let me just post what I'm trying to do, and maybe someone can give some suggestions before I dive into it. I have a datafile on disk, and it's binary, and I also have a STRUCT in C that corresponds to the structure of a record in the file. The file can contain from one to many records. I want to read in all the records and have access to them in my
java program. I have C++ code to make a linked list out of the data, so my next step is to design a java class that mimics the STRUCT, and then pass all the data in the linked list via JNI. The STRUCT is a mix of primitives and arrays (single and multi-dimensional) but I I could probably get by ignoring the multidimensional arrays because I don't really need that data. I will need some linar arrays, though. So I guess what I think I need is a native method that does this:
1. Instantiates an object representing a record
2. Populates the object from the current element in the C++ linked list
3. Puts the object in an ArrayList
4. Moves to the next record in the linked list and goes back to step 1 if there are more elements.
5. Returns the ArrayList, or returns nothing and simply populates the ArrayList by reference.
Does this seem like a reasonable project to undertake with JNI? Something I can crank out in a weekend, I hope.
Kindly,
Chris