jnajava对应类型_JNA编程之数据类型映射
数据类型 说明 来源 int8_t 带符号8位整数 uint8_t ⽆符号8位整数 int16_t 带符号16位整数 uint16_t ⽆符号16位整数 int32_t 带符号32未整数 uint32_t ⽆符号32位整数
1 ,当前路径是在项⽬下,⽽不是 bin 输出⽬录下。
2 ,数据结构的对应关系:
Java—C和操作系统数据类型的对应表
Java Type
C Type
Native Representation
boolean
int
32-bit integer (customizable)
byte
char
8-bit integer
unicode文件格式char
wchar_t
platform-dependent
short
short
16-bit integer
int
int
32-bit integer
long
long long, __int64
64-bit integer
float
float
32-bit floating point
double
double
64-bit floating point
Buffer
Pointer
pointer
platform-dependent (32- or 64-bit pointer to memory)
[] (array of primitive type)
pointer
array
32- or 64-bit pointer to memory (argument/return)
contiguous memory (struct member)全⽂参考:平安,幸福美满! 的⽇志,⽹址
blog.163/hbu_lijian/blog/static/126129153201212892143856/ 16位  1字节8位,2字节16位  4字节32位  8字节64位 char  1字节 short int  2字节 int 2字节 long int 4字节 指针 2字节 32 位系统: char 1
除了上⾯的类型, JNA 还⽀持常见的数据类型的映射。
char*
NUL-terminated array (native encoding ding )
WString
wchar_t*
NUL-terminated array (unicode)
char**
NULL-terminated array of C strings
WString[]
wchar_t**
NULL-terminated array of wide C strings
Structure
struct*
struct
pointer to struct (argument or return) ( or explicitly )
struct by value (member of struct) ( or explicitly )
Union
union
same as Structure
Structure[]
struct[]
array of structs, contiguous in memory
Callback
(*fp)()
function pointer (Java or native)
NativeMapped
varies
depends on definition
NativeLong
long
platform-dependent (32- or 64-bit integer)
PointerType
pointer
same as Pointer
Unsigned types use the same mappings as signed types. C enums are usually interchangeable with "int".参考链接:
github/twall/jna/blob/master/www/Mappings.md

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。