I am trying to use protobuf3 source code and it uses "sun.misc.Unsafe". Can you please let me know how to import the necessary package for it.Here is the sample code
Asked
Active
Viewed 2,974 times
0
-
Rephrased the question for readability. – zapping May 25 '16 at 07:38
2 Answers
0
This class will return you an Unsafe instance on almost all existing JVM implementations including Android (both VM versions): https://github.com/noctarius/tengi/blob/master/java/tengi-core/src/main/java/com/noctarius/tengi/core/impl/UnsafeUtil.java
this answer is a copy of noctarius' answer here: In Android, how to invoke sun.misc.Unsafe methods using Java reflection?
0
Unfortunately sun.misc.Unsafe
class not included in android standard library. But you can to use it between pre-compiled direct proxy class: https://github.com/iamironz/unsafe

Alexander Efremenkov
- 151
- 1
- 2
- 9