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

后端 未结 6 1682
南方客
南方客 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:18

    A better way might by to store it in a byte array, since native pointers aren't very Java-ish in the first place. ints and longs are better reserved for storing numeric values.

提交回复
热议问题