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:
“Our children evaluate themselves based on the opinions we have of them. When we use harsh words, biting comments, and a sarcastic tone of voice, we plant the seeds of self-doubt in their developing minds.... Children who receive a steady diet of these types of messages end up feeling powerless, inadequate, and unimportant. They start to believe that they are bad, and that they can never do enough.”
—Stephanie Martson (20th century)