Is there an easy way to get the native sizeof(int) from the Java VM running on a particular platform? The value I want is not Integer.SIZE, in particular - the size of a Java int, but rather what you'd get from sizeof(int) in C on the platform.
I need this because I'm using a particular library that reads and writes binary files, and trying to parse those files, whose interpretation depends in a particular way on the size of the machine int. I'd like it to be portable.
I get the impression that including JNA will give me that capability - but I'd rather not have to include a native library dependency (again, portability), and I don't want to play nasty games like the only solution I could come up with offhand - allocating many direct int buffers and looking at management/memory metrics before and after. That's a hack and not reliable...