Thanks for your help.
But now I have a new problem: after calling the native function my application
terminates itself, no error message, no exception and no vm crash. The return
value of the function is a pointer (void*).
-----Ursprüngliche Nachricht-----
Von: "Nikolas Lotz" <nlo...@nde.ag>
Gesendet: 13.01.09 15:51:19
An: use...@jna.dev.java.net
Betreff: Re: [jna-users] How to create a pointer from byte[]?
How can I create a Pointer from a byte array ?
try to create a new chunk of memory, fill it with your XML-data and don't
forget the terminating zero-byte:
--- snip -------------------------------------------
byte[] xmlData = ...;
Memory xmlBuffer = new Memory(xmlData.length + 1);
xmlBuffer.write(0, xmlData, 0, xmlData.length);
xmlBuffer.setByte(xmlData.length, 0);
--- snap -------------------------------------------
now you can pass 'xmlBuffer' as a pointer ...
One of the parameteres of the Pointer.write(...) method is the offset
('offset - byte offset from pointer into which data is copied'). What is
this offset? I don't understand the description in the javadoc.
this would be the 'destination offset' ...
Vorsitzende des Aufsichtsrates: Angelika Mozdzen
Sitz und Registergericht: Hamburg, HRB 90934
Vorstand: Jens-U. Mozdzen
USt-IdNr. DE 814 013 983