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:
“As for types like my own, obscurely motivated by the conviction that our existence was worthless if we didnt make a turning point of it, we were assigned to the humanities, to poetry, philosophy, paintingthe nursery games of humankind, which had to be left behind when the age of science began. The humanities would be called upon to choose a wallpaper for the crypt, as the end drew near.”
—Saul Bellow (b. 1915)