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 major universities are now stuck with an army of pedestrian, toadying careerists, Fifties types who wave around Sixties banners to conceal their record of ruthless, beaverlike tunneling to the top.”
—Camille Paglia (b. 1947)