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 longMask 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 TypeMethodDescriptionvoidcopyMemory(byte[] src, long srcIndex, long targetOffset, long length) voidcopyMemory(long srcOffset, byte[] target, long targetIndex, long length) booleangetBoolean(Object target, long offset) bytegetByte(long address) bytedoublefloatintgetInt(long address) longgetLong(long address) getStaticObject(Field field) voidputBoolean(Object target, long offset, boolean value) voidputByte(long address, byte value) voidvoidvoidvoidputInt(long address, int value) voidputLong(long address, long value) private static intsmallAddress(long address) Truncate alongaddress into a shortintaddress.booleanMethods 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 alongaddress into a shortintaddress. -
getStaticObject
- Specified by:
getStaticObjectin classUnsafeUtil.MemoryAccessor
-
getByte
- Specified by:
getBytein classUnsafeUtil.MemoryAccessor
-
putByte
- Specified by:
putBytein classUnsafeUtil.MemoryAccessor
-
getBoolean
- Specified by:
getBooleanin classUnsafeUtil.MemoryAccessor
-
putBoolean
- Specified by:
putBooleanin classUnsafeUtil.MemoryAccessor
-
getFloat
- Specified by:
getFloatin classUnsafeUtil.MemoryAccessor
-
putFloat
- Specified by:
putFloatin classUnsafeUtil.MemoryAccessor
-
getDouble
- Specified by:
getDoublein classUnsafeUtil.MemoryAccessor
-
putDouble
- Specified by:
putDoublein classUnsafeUtil.MemoryAccessor
-
supportsUnsafeByteBufferOperations
public boolean supportsUnsafeByteBufferOperations()- Overrides:
supportsUnsafeByteBufferOperationsin classUnsafeUtil.MemoryAccessor
-
getByte
public byte getByte(long address) - Specified by:
getBytein classUnsafeUtil.MemoryAccessor
-
putByte
public void putByte(long address, byte value) - Specified by:
putBytein classUnsafeUtil.MemoryAccessor
-
getInt
public int getInt(long address) - Specified by:
getIntin classUnsafeUtil.MemoryAccessor
-
putInt
public void putInt(long address, int value) - Specified by:
putIntin classUnsafeUtil.MemoryAccessor
-
getLong
public long getLong(long address) - Specified by:
getLongin classUnsafeUtil.MemoryAccessor
-
putLong
public void putLong(long address, long value) - Specified by:
putLongin classUnsafeUtil.MemoryAccessor
-
copyMemory
public void copyMemory(long srcOffset, byte[] target, long targetIndex, long length) - Specified by:
copyMemoryin classUnsafeUtil.MemoryAccessor
-
copyMemory
public void copyMemory(byte[] src, long srcIndex, long targetOffset, long length) - Specified by:
copyMemoryin classUnsafeUtil.MemoryAccessor
-