Mapping Types
The following table shows an overview of types mapping between Java and native code and supported by the JNA library.
Native Type | Size | Java Language Type | Common Windows Types |
---|---|---|---|
char | 8-bit integer | byte | BYTE, TCHAR |
short | 16-bit | short | short WORD |
wchar_t | 16/32-bit character | char | WCHAR, TCHAR |
int | 32-bit integer | int | DWORD |
int | boolean value | boolean | BOOL |
long | 32/64-bit integer | NativeLong | LONG |
long long, __int64 | 64-bit integer | long | |
float | 32-bit FP | float | |
double | 64-bit FP | double | |
char* | C string | String | LPCTSTR |
void* | pointer | Pointer | LPVOID, HANDLE, LPXXX |
Note: The meaning of TCHAR changes between char and wchar_t according to some preprocessor definitions. LPCTSTR follows.
Read more about this topic: Java Native Access
Famous quotes containing the word types:
“The wider the range of possibilities we offer children, the more intense will be their motivations and the richer their experiences. We must widen the range of topics and goals, the types of situations we offer and their degree of structure, the kinds and combinations of resources and materials, and the possible interactions with things, peers, and adults.”
—Loris Malaguzzi (19201994)