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:
“... there are two types of happiness and I have chosen that of the murderers. For I am happy. There was a time when I thought I had reached the limit of distress. Beyond that limit, there is a sterile and magnificent happiness.”
—Albert Camus (19131960)