Package com.google.protobuf
Class UnsafeUtil.Android32MemoryAccessor
java.lang.Object
com.google.protobuf.UnsafeUtil.MemoryAccessor
com.google.protobuf.UnsafeUtil.Android32MemoryAccessor
- Enclosing class:
UnsafeUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
Mask used to convert a 64 bit memory address to a 32 bit address.Fields inherited from class com.google.protobuf.UnsafeUtil.MemoryAccessor
unsafe
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
copyMemory
(byte[] src, long srcIndex, long targetOffset, long length) void
copyMemory
(long srcOffset, byte[] target, long targetIndex, long length) boolean
getBoolean
(Object target, long offset) byte
getByte
(long address) byte
double
float
int
getInt
(long address) long
getLong
(long address) getStaticObject
(Field field) void
putBoolean
(Object target, long offset, boolean value) void
putByte
(long address, byte value) void
void
void
void
putInt
(long address, int value) void
putLong
(long address, long value) private static int
smallAddress
(long address) Truncate along
address into a shortint
address.boolean
Methods inherited from class com.google.protobuf.UnsafeUtil.MemoryAccessor
arrayBaseOffset, arrayIndexScale, getInt, getLong, getObject, objectFieldOffset, putInt, putLong, putObject, supportsUnsafeArrayOperations
-
Field Details
-
SMALL_ADDRESS_MASK
private static final long SMALL_ADDRESS_MASKMask used to convert a 64 bit memory address to a 32 bit address.- See Also:
-
-
Constructor Details
-
Android32MemoryAccessor
Android32MemoryAccessor(sun.misc.Unsafe unsafe)
-
-
Method Details
-
smallAddress
private static int smallAddress(long address) Truncate along
address into a shortint
address. -
getStaticObject
- Specified by:
getStaticObject
in classUnsafeUtil.MemoryAccessor
-
getByte
- Specified by:
getByte
in classUnsafeUtil.MemoryAccessor
-
putByte
- Specified by:
putByte
in classUnsafeUtil.MemoryAccessor
-
getBoolean
- Specified by:
getBoolean
in classUnsafeUtil.MemoryAccessor
-
putBoolean
- Specified by:
putBoolean
in classUnsafeUtil.MemoryAccessor
-
getFloat
- Specified by:
getFloat
in classUnsafeUtil.MemoryAccessor
-
putFloat
- Specified by:
putFloat
in classUnsafeUtil.MemoryAccessor
-
getDouble
- Specified by:
getDouble
in classUnsafeUtil.MemoryAccessor
-
putDouble
- Specified by:
putDouble
in classUnsafeUtil.MemoryAccessor
-
supportsUnsafeByteBufferOperations
public boolean supportsUnsafeByteBufferOperations()- Overrides:
supportsUnsafeByteBufferOperations
in classUnsafeUtil.MemoryAccessor
-
getByte
public byte getByte(long address) - Specified by:
getByte
in classUnsafeUtil.MemoryAccessor
-
putByte
public void putByte(long address, byte value) - Specified by:
putByte
in classUnsafeUtil.MemoryAccessor
-
getInt
public int getInt(long address) - Specified by:
getInt
in classUnsafeUtil.MemoryAccessor
-
putInt
public void putInt(long address, int value) - Specified by:
putInt
in classUnsafeUtil.MemoryAccessor
-
getLong
public long getLong(long address) - Specified by:
getLong
in classUnsafeUtil.MemoryAccessor
-
putLong
public void putLong(long address, long value) - Specified by:
putLong
in classUnsafeUtil.MemoryAccessor
-
copyMemory
public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) - Specified by:
copyMemory
in classUnsafeUtil.MemoryAccessor
-
copyMemory
public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) - Specified by:
copyMemory
in classUnsafeUtil.MemoryAccessor
-