What is the 'correct' way to store a native pointer inside a Java object?

后端 未结 6 1674
南方客
南方客 2020-11-30 06:38

What is the \'correct\' way to store a native pointer inside a Java object?

I could treat the pointer as a Java int, if I happen to know that native poi

6条回答
  •  暖寄归人
    2020-11-30 07:04

    You could look to the way C# handles this with the IntPtr type. By creating your own type for holding pointers, the same type can be used as a 32-bit or 64-bit depending on the system you're on.

提交回复
热议问题