1 message in net.java.dev.jna.usersRe: [jna-users] jna structure endianess
FromSent OnAttachments
Timothy WallFeb 13, 2008 5:42 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] jna structure endianessActions...
From:Timothy Wall (twal@dev.java.net)
Date:Feb 13, 2008 5:42:33 am
List:net.java.dev.jna.users

The Structure methods read() and write() perform all necessary conversions between the Java data and native memory. You don't normally have to do any explicit conversion.

On Feb 13, 2008, at 7:28 AM, vswork wrote:

Good day,

I have structure

class MyStructure extends Structure {

...

int field;

...

}

Instance of MyStructure is filled during call to native method to DLL on x86 via JNA.

Question is: should field on return from JNA fieldhave value in java- endian (big-endian) or little-endian of x86?

My result is that field have little-endian format, which, of course, unfortunate, as I can't use MyStructure after call return without further conversions.

And another question is: how can I tell jna to automatically convert endianess?